| 

.NET C# Java Javascript Exception

10
Hi all, if you want to administer your farm using PowerShell but don’t want to log on using the farm account all the time, then, starting the  you might encounter the following error: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered. This occurs even when you right click the Management Shell’s […]

Hi all,

if you want to administer your farm using PowerShell but don’t want to log on using the farm account all the time, then, starting the  you might encounter the following error:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

This occurs even when you right click the Management Shell’s icon and run it using “Run as Administrator”. There is a way of getting past this, and the solution is quick.

You need to run the “runas” command from cmd.exe, specifying an account with sufficient rights. You should use the following flags:

 

  • /user:yourdomain\youruser (specification of the correct account)
  • /savecred (ensures you only have to enter the password once)

The part with specifying the .ps1 file, which is located in the hive folder, is a bit tricky: Since it contains whitespaces in the most cases (C:\Program Files), you need to quote it the right way so runas, and subsequently PowerShell.exe can find the sharepoint.ps1 registration script. The full command looks like this:

 

runas /user:yourdomain\youruser /savecred "C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1^’"

 

As usual, before running any script, evaluate well. The script will not run unless you modify and adapt it to your needs. Do always execute on a test environment first in order to avoid unwanted side effects. I will not take responsibility for any damages done to your environments, be it developer’s, testing or productive environments.

 

Link to Script:

You can download the script from SkyDrive, contained in a zip file. It is better than copying from a website, where the quotes are always messed up.

 

Hope this was of help!

Best regards,

Martin


sharepoint-2010 powershell tips administration configuration script automation administrator hive local-famr-is-not-accessible farm-account featuredependencyid 14 accessibility sharepoint.ps1 user registration rights-management runas-cmd.exe-sharepoint-management savecred
Schreibe einen Kommentar:
Themen:
savecred runas-cmd.exe-sharepoint-management rights-management registration user sharepoint.ps1 accessibility 14 featuredependencyid farm-account local-famr-is-not-accessible hive administrator automation script configuration administration tips powershell sharepoint-2010
Entweder einloggen... ...oder ohne Wartezeit registrieren
Benutzername
Passwort
Passwort wiederholen
E-Mail