An introduction to PowerShell remoting – Part 1
One of the exciting features of PowerShell v2 is remoting. In a series of posts, I am going to go through PowerShell remoting and explore its features. Some topics I will cover are:
- Getting Started
- Setting up your environment
- Commands and Cmdlets
- Security
- Random things to do with remoting
Warning: If you are a member of the SE Michigan PowerShell Users group, please close your eyes as I will be presenting on this the next two months.
In this first post we are going to go through what you need to make PowerShell remoting work on your network and some things you need to know about remoting before you start. So lets get started.
What you need
If you are lucky to be running Windows 7 or Windows Server 2008 R2, you already have the necessary software to get PowerShell remoting up and running. However, if you are running any of the following you will need the Windows Management Framework and the .NET Framework 2.0 or later.
- Windows XP Service Pack 3
- Windows Vista Service Packs 1 or 2
- Windows Server 2003 Service Pack 2
- Windows Server 2003 R2
- Windows Server 2008 Service Pack 2
The Windows Management Framework includes Windows PowerShell 2.0, Windows Remote Management (WinRM) 2.0 and Background Intelligent Transfer Service (BITS) 4.0. You can download the framework here.
To find out what version of PowerShell you are using, you can use the variable $PSVersionTable. You want $PSVersionTable.Version.Major to be 2. Here is the output from one of my lab PC’s running Windows 7.
Some things to know
As I was going through starting to configure PowerShell remoting, here are some things I found.
- Both the remote and local computers must be configured to use remoting.
- You must have PowerShell and the related bits installed on all machines.
- You can both run scripts remotely as well has have an interactive session with a remote PC.
- You must be a member of the Administrators group on the remote PC or provide valid credentials with Admin privileges.
- On current versions of windows. The network type must be work or home. Public will not work.
- Any policies, ie group policies, on the remote pc are in effect in remote PowerShell sessions. Keep that in mind if something isn’t working as expected.
Where we go from here
In the next post, I will go over enabling PowerShell remoting. If you are following along at home, you will need to have the necessary software installed to continue with the examples. If you have any questions or comments please leave them here, email feedback [at] mwjcomputing [dot] com, or contact me on Twitter at @mwjcomputing.
-Matt
Updated 1/5/2009: Updated to include service pack info for Windows OSs. Thanks to Aleksandar Nikolić for the reminder!