Category Archives: SharePoint Administration

[SharePoint4MEA : Arabic Video] Creating SharePoint 2013 Web Applications

We are progressing very quickly. Today we’ve published the 4th lesson in the SharePoint 2013 Administration Arabic course to SharePoint4MEA YouTube channel.

318

 

Today’s lesson is all about “Creating SharePoint 2013 Web Application”, you can watch it from here .

Last but not least, and thanks guys for the amazing feedback!

318-1 318-2 318-3

 

Also Watch:

Lesson 1 : Preparing for SharePoint 2013 Installation
Lesson 2 : Installing SharePoint Server 2013
Lesson 3 : The logical Architecture of SharePoint 2013

Advertisement

More robust usage of OpenWeb()

1:  using(SPSite site = new Site(http://www.portal.com)) 
   2:  {    
   3:      SPWeb web = site.OpenWeb("/anotherWeb/"); // no exception
   4:   
   5:      string title = web.Title;  // throws exception
   6:  }

 

The first line in the using clause will not throw an exception even if anotherWeb doesn’t exist , but you’ll encounter a FileNotFoundException exception in the second line since web is a null reference.

To make your code more robust, you should check the existence of the web before using it as follows:

   1:  using(SPWeb web = site.OpenWeb("/anotherWeb/"))
   2:  {
   3:     if(web.Exists)
   4:     {
   5:         string title = web.Title;
   6:     }
   7:  }

Alternatively, The SPSite.OpenWeb method has a (string, bool) overload. If you set the bool to true you should get an exception if the site doesn’t exist. Waldek Mastykarz has explained this behavior on his blog @http://blog.mastykarz.nl/inconvenient-opening-spsite-openweb.

Usage Analysis is not capturing information for Web Application

Just thought of sharing this MSDN forum-thread with my blog followers since I have received this question more than once. Usage Analysis is really a common source of confusion among SharePoint administrators.

Q :

I have 3 Web Applications, webapp1, webapp2 and I recently added webapp3. each web application hosts about 5 site collections.
I have enabled usage analysis processing  on the farm level but it’s only capturing information for web app1 and web app2. And it’s not capturing any information for any site collection for web app3.

A :

Usage reporting from within MOSS runs on a daily schedule that is user configurable from the central administration, you must wait at least one day for any meaningful reporting to be available for new web application. By the way you should activate the reporting feature on all the site collections in the web application.

Q :

I have already activated the reporting feature on all the site collections and about 48 hours elapsed to collect the usage statistics.

A :

Run the following commands from the command prompt, wait for 24 hours and it should work.

stsadm -o setproperty -pn job-usage-analysis -pv no

stsadm -o setproperty -pn job-usage-analysis -pv yes


This sequence disables, then re-enables the job-usage-analysis job within SharePoint. It’s important to execute this sequence after adding new web applications.
Let me know after 24 hours.

Q :

Now the new web application usage info is captured.

A :

Note that when you add a new Web application to MOSS, usage analysis is not automatically reconfigured. In order to make usage analysis processing available for the new Web application, you must disable, then re-enable via central administration or through STSADM as I showed you.

“The specified network name is no longer available” Exception when using SharePoint Search API!

I ran into a very weird issue that caused me a real headache when using SharePoint Search API !
Below is the code I was using :

FullTextSqlQuery fts = new FullTextSqlQuery(site);
fts.QueryText = "SELECT AccountName FROM portal..scope()…";
fts.ResultTypes = ResultType.RelevantResults;
fts.RowLimit = 100;
ResultTableCollection rtc = fts.Execute();

 

When the last line executes, an exception is thrown with the following message :

The specified network name is no longer available. (Exception from HRESULT:
0x80070040), Exception Stack Trace :    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(
Int32 errorCode, IntPtr errorInfo)     at Microsoft.Office.Server.Search.Query.FullTextSqlQuery.Execute()

I have also received the following error in the SharePoint Trace Logs:

10/05/2009 20:03:10.18 OWSTIMER.EXE (0x0850)                              0x08D0 Search Server Common                MS Search Administration                  0              High       Log Query:  More Information: The specified network name is no longer available.

Additionally, I have seen this error in the Windows Application log of the SharePoint web front end server:

Office Server Search EventID: 10038 Level: Error Query machine ‘<ServerName>’ has been taken out of rotation due to this error: The specified network name is no longer available. 0x80070040. It will be retried in 15 seconds.

Resolution:

This problem may occur because of an error in Windows Server 2008. If you use the TransactNamedPipefunction to request more than 8,000 bytes of data, Windows Server 2008 does not transfer the data correctly. To solve this issue, install the hotfix from KB 946487 on all Windows Server 2008 machines in the SharePoint farm, this will do the trick!

Hope this helps 🙂

Tracing Service Lost Trace Events

Sometimes you will encounter something very weird in the ULS logs. The only entries that are logged are “Tracing service lost trace events” log entries. To resolve this issue, just restart your Tracing service. You can do that from the command line using the following commands:

net stop sptrace (to stop the tracing service)
net start sptrace (to start the tracing service)

40

This will do the trick for you.

In addition, you may want to check out the free SharePoint Troubleshooting issue I recently authored forUnderstanding SharePoint Journal .

Creating mailing lists for SharePoint sites and blogs [No Code Required]

A few days ago my first article for EndUserSharePoint.com went live. This article is the first one of a series titled “Creating mailing lists for SharePoint sites and blogs [No Code Required]”. You can always follow my articles at EUSP by selecting my name from the drop down list shown at the top of the home page as illustrated in the figure below.

37

Upgrade SQL Express to Standard or Enterprise for MOSS 2007

Microsoft so very graciously provides a free version of SQL 2005, SQL Express, with MOSS. If you install MOSS using the Basic option or Single Server under Advanced you get SQL Express automatically. So what if as a budding newbie SharePoint admin you chose the Basic option, but now as a wise aged SharePoint admin you’ve seen the error of your ways and want to use a more respectable version of SQL for your SharePoint backend? You’re in luck. This blog post will walk you through upgrading SQL Express to SQL Standard or Enterprise.

Restricted Read Permission Level

When you create a site collection from MOSS publishing site template , you get an OOB permission level called “Restricted Read” . The description of Restricted Read in SharePoint is “Can view pages and documents, but cannot view historical versions or review user rights information.”
This is true. But, you can also use this permission level to give users permission to open items in a list without letting them to navigate to the list and enumerate the list items. For example, if you have a document that you want to share with all the portal users, you can upload it to a document library and provide a link from the home page to it and you can still prevent the portal users from browsing the document library directly.
Nice and easy 🙂

Limited Access ???

A question that I always receive from my colleagues! What is the limited access permission level ?
Users with permissions to access specific lists ONLY, will have Limited Access permission level within the parent site. And this works in the same way for list items and list folders. Remember that a list inherits from a site and a folder inherits from a list and a list item inherits from a folder or a list. The Limited Access permission level cannot be customized or deleted and you cannot assign this permission level to users or SharePoint groups.
For more information about “Limited Access” permission level, I’d recommend usingSPLimitedAccessDiscovery which breaks down why some accounts show up on SharePoint sites as “Limited Access”.

SharePoint and Managed Paths

Having a solid understanding of Managed Paths is a definite must for any SharePoint administrator.

A managed path is defined as the path in the URL that is managed by SharePoint. As an example, sites is the managed path in http://MyServer/sites/Ayman. Managed paths cannot be limited for use by specific security groups, nor can they be targeted directly with audiences. They are simply a way to organize a large quantity of site collections.
There are 2 types of managed paths (Explicit and Wildcard). Explicit managed paths allow you to create a single site collection at that specific path only. Wildcard managed paths allow you to create multiple site collections using that managed path.

Here are some examples…

Explicit Managed Path: Accounting
Wildcard Managed Path: Departments

Site Collection URL created using the explicit managed path: http://company/accounting
Site Collection URL’s created using the wildcard managed path: http://company/departments/accounting,http://company/departments/hrhttp://company/departments/it

As you can see the “departments” wildcard path acts as a placeholder to create site collections related to “departments”. The reason why i say it represents a phyiscal hierarchy is because if this were a normal asp.net web site there would be a physical folder structure on the hard drive somewhere and departments would be that folder. What managed paths allow you to do is represent that physical structure in the URL for the end users and allow for organization on the administrators part. Plus everything in sharepoint is stored in a database, so there are no physical heirarchies. Managed paths allow you to create that feel.

Now, Can you create a site collection under another one ?
Try to answer