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

Advertisements

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.