Connect PowerShell to remote SharePoint 2010 Server

Why RDP or login to a SharePoint server when all you really need to do is run some good old PowerShell commands?  Plus I Highly recommend using the PowerShell IDE.  This way you can script in a nice editor and run the commands below it.  The interface is awesome.

Go through this guide to setup the Server and then your client to allow the remote PowerShell and the credential type:

Note:  In PowerShell IDE there is an icon and File command for New Remote PowerShell Tab.  This is nice, but I like to save a lot of things and I am nearly 100% SharePoint  so I like to run the script for the Add-PsSnapin SharePoint so that I can talk to SharePoint.

Here is the setup guide so you can script your own connections:
http://blogs.msdn.com/b/opal/archive/2010/03/07/sharepoint-2010-with-windows-powershell-remoting-step-by-step.aspx

When I want to connection to SharePoint I just run the script and all I have to enter is the password, and I could write that to an encrypted text file for future use, but you can search for how to do that.  Save this as a .ps1 script:


$Credential = "domain\username"
$Server = "spserver"

Enter-PSSession -ComputerName $Server -Authentication Credssp -Credential $Credential

Add-PsSnapin Microsoft.SharePoint.PowerShell

Comments

Popular posts from this blog

SharePoint Designer 2013 Approval Workflow with Comments

Change SharePoint server hostname and Web Application Names

The Timer Service Failed to Recycle