Tuesday, May 5, 2009

Does Operating System edition matters with powershell ?

Yes, it does matters when accessing Sharepoint Object Model through powershell.

Make sure that you use PowerShell 64 bit when you trying to manipulate the SharePoint object model from a script on a 64 bit OS machine.

If you try run a script that accesses the SharePoint object model in a 32 bit PowerShell window from a 64 bit OS, you will run into errors that are rather hard and confusing to diagnose: The error you will receieve will be as below which is totally misleading.

Error: “The Web application at http://servername could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.”At line:1 char:38+ $spsite=[Microsoft.SharePoint.SPSite]( <<<< “http://servername”)

I hope this post saves some time for someone in sharepoint world !

No comments:

Post a Comment