Online Training On SharePoint
                      

Friday 20 November 2009

Error while working with PowerShell

I was trying to put my hands around PowerShell and I was encounring a strange error. I was running one cmdlet Get-SPWebApplication in Windows Server 2008 Server and it was throwing this error:
"Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again."


I tried all the cmdlets but the same error keep coming. After some more investigation I found that the solution and it was that the PowerShall needs to be executed as Administrator. While running powershell it shows 2 option:


If we just click the open it will open a PowerShell window and this message will come:


and all the cmdlets will show the error message as shown. To run the PowerShell scripts we should use the second option of running as Administrator.

2 comments:

Anonymous said...

Thanks. This solved the same error for me :)

Brent V said...

Thank you so much. I keep forgetting that.

Related Posts with Thumbnails