Windows Remote Management: Use the command line remotely

Analysis
Feb 12, 20093 mins

Fresh outages strike Microsoft NZ services
Credit: Emagnetic / Shutterstock

The following is a guest post by J. Peter Bruzzese, Infoworld blogger and author of Microsoft Subnet’s February book giveaway Exchange Server 2007 How-To (enter to win a free copy here or read an excerpt here). He writes: Windows Remote Management (WinRM) is Microsoft’s implementation of the WS-Management Protocol, a SOAP-based, firewall-friendly protocol that can used in a variety of ways to allow your system to talk to different hardware from varying vendors.

WinRM is actually part of the operating system itself (with Server 2008, although in 2003 you have to add it in through Add/Remove System Components) but to connect to another system you have to enable what is called a WinRM listener and then you can proceed with command-line control. You might be wondering… why would I need WinRM and what could I use it for?  Well, working through the command-line, especially if you are proficient at it, can be an excellent way to quickly check on servers and accomplish a host of tasks.  More specifically though, you might want to use it to connect to a Server Core system.

Assuming your Server Core system has already been added to the domain and you have logged in as an administrator from that Server Core system (that is an important step or you may find WinRM doesn’t work for you when you try to connect) you can perform the following.

1. Type WinRM quickconfig at the command-prompt.

2. From another system open a command-prompt.

3. You are going to use WinRS.exe to initiate all your commands to the remote Server Core system.  So, as an example type:  winrs –r: cmd.exe

Performing a cmd.exe will put you right within the command prompt of the Server Core system.  From there all your future commands will be run as if on the Server Core system locally.  At this point you can perform any of the command line tasks you normally would locally at the Server Core system but through the Remote Shell.

If you don’t have a Server Core system, try the same steps out with a standard server and you will appreciate the great new way you have to remotely administer it.  Now you just have to re-remember (or learn for the first time) command-line administration.  It takes some practice, but I promise it is quite exhilarating to execute commands again.  Brings back that old ‘War Games’ feeling you had as a youth.

Visit the Microsoft Subnet web site for more news, blogs, podcasts. Subscribe to all Microsoft Subnet bloggers.bi-weekly Microsoft newsletter. (Click on News/Microsoft News Alert.)

Sign up for the Will Windows 7 upgrade strategy keep XP users away…no! Microsoft My Phone goof: A cool mobile sync app but has serious drawbacks Best Microsoft-related Tweets (and list of MS Tweeps) OCS 2007 R2 proclaimed the PBX killer