SharePoint Managment Shell via remote session

You can run a SharePoint Management Shell remotely with the following lines of powershell

 

 

Note, that at this point, you can run whatever administrative PowerShell commands you need to run by using the Invoke-Command -Session $session -ScriptBlock{} syntax.

e.g.

 

If you get any errors when attempting to do this, make sure remoting is enabled on the SharePoint server and that you are using an account that has farm admin access and Shell admin access.

Here’s a technet on enabling remote access for server management.

https://msdn.microsoft.com/en-us/library/dd759202.aspx#BKMK_ps

Leave a Reply