Windows PowerShell 2.0 on Server 2008/R2, which is also a required for SharePoint 2010, supports Remoting. We can manage SharePoint
2010 remotely with Windows PowerShell prompt from our local machine.
Here is what needs to be done to remotely control SharePoint using powershell.
Follow the steps in the link to install Powershell
http://support.microsoft.com/kb/968929/en-us
(The -force parameter is not required but does not hurt if we want to avoid some blockage)
This sets up our SharePoint server to be controlled remotely
If our current user on client machine has permission to the SharePoint farm and Windows PowerShell on the remote box, we can use just Enter-PSSession to create and enter the remote session.
For example, connecting to sarav. sharepoint.com…
Enter-PSSession -ComputerName sarav.sharepoint.com
If it works, the command prompt will be changed to...
[sarav.sharepoint.com]: PS C:\Users\Administrator\>.
We can close the session by typing Exit
To connect to a machine with CredSSP and a different credential, we can use
Enter-PSSession -ComputerName sarav.sharepoint.com -Authentication CredSSP –Credential domain\username
This command will bring up the authentication window where we can enter the password
Now we just have to load the SharePoint Windows PowerShell Snap-in and we are ready to remotely control our SharePoint environment
Add-PSSnapin Microsoft.SharePoint.Powershell
Here is what needs to be done to remotely control SharePoint using powershell.
Prerequisite
Windows Powershell: By default windows powershell is available on all windows 7 and windows 8 machines. If not we can download powershell and install on our local machine.Follow the steps in the link to install Powershell
http://support.microsoft.com/kb/968929/en-us
Steps
Commands to run on the SharePoint server:
- Enable-PSRemoting -Force
- Enable-WSManCredSSP -Role Server -Force
Command to run on the client machine
Enable-WSManCredSSP -Role Client -DelegateComputer * -Force(The -force parameter is not required but does not hurt if we want to avoid some blockage)
This sets up our SharePoint server to be controlled remotely
Using Remote PowerShell
If our current user on client machine has permission to the SharePoint farm and Windows PowerShell on the remote box, we can use just Enter-PSSession to create and enter the remote session.
For example, connecting to sarav. sharepoint.com…
Enter-PSSession -ComputerName sarav.sharepoint.com
If it works, the command prompt will be changed to...
[sarav.sharepoint.com]: PS C:\Users\Administrator\>.
We can close the session by typing Exit
To connect to a machine with CredSSP and a different credential, we can use
Enter-PSSession -ComputerName sarav.sharepoint.com -Authentication CredSSP –Credential domain\username
This command will bring up the authentication window where we can enter the password
Now we just have to load the SharePoint Windows PowerShell Snap-in and we are ready to remotely control our SharePoint environment
Add-PSSnapin Microsoft.SharePoint.Powershell
..............
SharePoint | Remote SharePoint Management | PowerShell | Administration
Saravjeet Lamba
No comments:
Post a Comment