Archive for November, 2011

Using PowerShell To Get Detailed Information about Correlation IDs in SharePoint 2010

November 15, 2011 Leave a comment

I love PowerShell, and I love how now with SharePoint 2010 you are given a unique Correlation ID for errors that can be used in helping you search for these errors in the SharePoint ULS Logs.

However, I hate searching ULS Logs sure I can use ULS Viewer to help me track down my problem via filters, however why use that when you have PowerShell.

Follow these steps below, which will search the ULS logs for the Correlation ID and pipe it out into detailed columns with information relevant to the error.

1.  Log into your SharePoint or CA server doesn’t matter just as long as you can access the SharePoint 2010 Management Shell for your farm.
2.  Bring up SharePoint 2010 Managment Shell
3.  Next Type:  Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | ft Category, Message -Autosize
4.  Hit Enter

It might take a few minutes for PowerShell to grab the ULS logs and search for the Correlation ID.

You should then be presented with two columns (Category and Message) with detailed information about the error.  This should help you narrow down the problem.  This also eliminates having to open up all your ULS log files and searching or loading them up in ULS viewer.  It’s alot quicker and proficent in my opinion.

For a much clearner/readable output type this in step 3:

Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | select Area, Category, Level, EventID, Message | Format-List

If you would like to pipe it out to a text file do this:

Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | select Area, Category, Level, EventID, Message | Format-List > c:\CorrelationID.log

Error: FILESTREAM is Disabled when Restoring SharePoint Databases from SQL 2008 to SQL 2008 R2

November 3, 2011 1 comment

I was migrating my SharePoint 2010 databases from a SQL 2008 SP2 server to a new SQL 2008 R2 Server by doing backups and restores.  I ran into an issue on a specific database that would not let me restore.  When attempting to restore I keep getting this error:

System.Data.SqlClient.SqlError: FILESTREAM feature is disabled. (Microsoft.SqlServer.Smo)

To enabled FILESTREAM on SQL 2008 Server R2.

1.  Open up SQL 2008 Server Studio Manager
2.  Open up a new Query
3.  Type:  EXEC sp_configure  filestream_access_level, 2
4.  Execute command
5.  Next type: RECONFIGURE
6.  Excecute command.

Now try to do a database restore, the database should restore with no problem.

Resetting the SharePoint 2010 Farm PassPhrase

November 1, 2011 Leave a comment

When attempting to add a new server to your SharePoint 2010 farm and you are asked for that PassPhrase that you should have written down and kept in a safe place when you initially configured SharePoint, but somehow you’ve forgotton it or a mysterous swosh of air carried away your little passphrase notebook.  No worries Powershell to the rescue.  Follow the steps below to reset the Farm PassPhrase.  Now there is no way to retrieve your passphrase; only to reset it.

1.  Log into your Central Administration Server (CA)
2.  Bring up SharePoint 2010 Management Shell (PowerShell)
3.  Type: $passphrase = ConvertTo-SecureString -asPlainText -Force
4.  Type in your new passphrase hit enter.
5.  Type: Set-SPPassPhrase -PassPhrase $passphrase -Confirm
6.  Retype in your new passphrase hit enter.
7.  Next Confirm the Action by typing in “Y” for Yes, hit enter

Your new passphrase will now be set.  Remember this time to write down this Passphrase in a safe place and lock it away.

Now try to re-add a new server to the SharePoint farm.  This time things should work as planned.