Real Time Web Analytics How to Install PowerShell on Windows Server 2003 and Enable Remote PowerShell Management–All Servers Should Have This Done - ITProGuru Blog by Systems Management Expert Dan Stolts - Site Home - TechNet Blogs

How to Install PowerShell on Windows Server 2003 and Enable Remote PowerShell Management–All Servers Should Have This Done

       Build Your Lab! Download Windows Server 2012
       Don’t Have a Lab? Build Your Lab in the Cloud with Windows Azure Virtual Machines
       Want to Get Certified? Join our Windows Server 2012 "Early Experts" Study Group
Share with friends!

How to Install PowerShell on Windows Server 2003 and Enable Remote PowerShell Management–All Servers Should Have This Done

  • Comments 8
  • Likes

PowerShell is an incredible tool that will allow you to run scripts or commands on your server.  PowerShell is included with Windows Server 2008 R2 but it has to be added to Windows Server 2003.  I recently had a customer who got their server (DC) infected with a virus and it was a huge problem to do anything to the box because when they logged in (with any user) the virus kicked in and prevented them from running anything. Remote Management was NOT enabled on the server so they were in big trouble. If they had PowerShell installed this monumental problem would have been nothing but an annoyance.  So, take a bit of advice and install PowerShell on all your servers, just in case you ever need the power of PowerShell on your server you will have it available.   You must be on Windows Server 2002 Service Pack 2 (SP2) in order to use PowerShell v2.

First you need to download and install “Windows Management Framework” (Which gives you Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0) Details on this package as well as the download links can be found here http://support.microsoft.com/kb/968929

In this customers case they would have downloaded

Windows Management Framework Core (WinRM 2.0 and Windows PowerShell 2.0)

from:

DownloadDownload the Windows Management Framework Core for Windows Server 2003 package now. (http://www.microsoft.com/downloads/details.aspx?FamilyId=f002462b-c8f2-417a-92a3-287f5f81407e)

Or if they had a 64bit OS …

DownloadDownload the Windows Management Framework Core for Windows Server 2003 x64 Edition package now.

This will install as an OS Hotfix.  When I did it on my 2003 server, it did not create an icon for the PowerShell.exe program. 

I simply clicked Start-Run typed in powershell <ENTER> and PowerShell launched.  When I ran it the first time, PowerShell was automatically added to my freqently used programs but if you are not so lucky, you can manually create an icon for it.  The Powershell Executable is located at c:\windows\system32\WindowsPowerShell\v1.0\PowerShell.exe

You will want to make sure that remote management and WMI is enabled on the server. 

Start – Run – services.msc <ENTER>

Scroll down and find: Windows Management Instrumentation and Windows Remote Management (WS-Management) and make sure they are both started and set to run automatically.

Now, we need to enable remote sessions: 

Open PowerShell on the Windows 2003 Server and run the command Enable-psRemoting.

Open PowerShell Window

Enable-psRemoting <ENTER>

Now you should be able to go to a different computer that has powershell enabled and test connecting to the 2003 machine.  I my case I am connecting to the 2003 machine from a Windows 2008 R2 machine. From a 2008 R2 machine, open a PowerShell Windows and type in

If you have not enabled-psRemoting on the 2008 R2 box go ahead and do that while you are there. Let’s try the following from the 2008 machine to connect and remotely manage the 2003 machine

Open PowerShell windows and type…

Enter-psSession MachineName <ENTER>

Any commands you want to run will now run on the remote machine  see screenshot

to end your remote session type

Exit-psSession <ENTER>

PowerShellRemoteSessions

 

If you like this post, please contact me on Twitter @ITProGuru to let me know.  To keep from missing other posts, make sure you add an RSS to my blog.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Thanks for the article, it was very helpful for me. Unfortunately I'm holding back on installing powershell on a 2k3r2 production box due to it being a service monitor server. I need to figure out a way to install with no restart or schedule a maintenance just to install powershell. :(

  • "You must be on Windows Server 2002" - what version?

  • Easy to follow and works perfectly.  Thank You!!!

  • Nice article, BUT

    You need change one mistake in "You must be on Windows Server 2002 Service Pack 2 (SP2) in order to use PowerShell v2."

    I indicate on Server 2002 (???).

  • Very very helpful.
    Thank you

  • To enable an HTTPS listener on the host:

    New-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Transport="HTTPS";Address="IP:x.x.x.x"} -ValueSet @{Hostname="host.fqdn.name";CertificateThumbprint="xxxxxxxxxx"}

    Obviously replace x.x.x.x, host.fqdn.name and xxxxxxxxxx with the appropriate values.

    On the client:

    Enter-psSession -ComputerName host.fqdn.name -Credential machine-or-domain\user -UseSSL

    The client needs to trust the host CA, so place the host's CA certificate in the machine trusted CA store.

  • Forgot to add:
    Make sure that the host certificate is issued to the correct host FQDN name and is in the machine personal store.

  • does the Microsoft Licensing applies if we install this in the Windows 2003 server