Forum Discussion

Nissan Dookeran's avatar
Nissan Dookeran
Copper Contributor
Jan 06, 2018
Solved

Cannot execute SharePoint Powershell commands from remote powershell

I am trying to use Powershell remoting to run SharePoint Powershell commands from my client machine after remoting to the SP Server. I am getting the following error Cannot access the local farm. V...
  • Bill_Ayers1's avatar
    Feb 07, 2018

    Try running PowerShell "As Administrator", then (substituting farm credentials)

     

    runas.exe /noprofile /env /user:domain\farmadmin "powershell.exe"

     

    This should start new PowerShell window running as the Farm Administrator. Then:

     

    asnp microsoft.sharepoint.powershell

     

    You can use

     

    Add-SPShellAdmin domain\username

     

    to give yourself Shell Admin access.

     

     

Resources