Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I enable a serial console on Windows (2008 and/or 2012) such that I can log into it like the Good Old Days of Real Servers and issue provisioning commands, ideally via PowerShell?

$ cu -l /dev/ttyS0
Connected.

Welcome to ad1.adlab.brazzers.com

Microsoft Windows [Version 6.1.7601]
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

Login: Administrator
Password: 

PS C:\Users\Administrator> New-NetIPAddress –InterfaceAlias eth0 –IPv4Address 192.168.101.11 –PrefixLength 24 -DefaultGateway 192.168.101.1

PS C:\Users\Administrator> 
share|improve this question
    
LOL, is this real? :D –  Ryan Ries Nov 12 '13 at 0:54
2  
I may not have slept last night, consequently I am now dreaming of a better world. –  MikeyB Nov 12 '13 at 0:56

1 Answer 1

up vote 19 down vote accepted

Wow, well, what you want is called Emergency Management Services (EMS) redirection.

http://msdn.microsoft.com/en-us/library/ff542282(v=vs.85).aspx

And it works on modern versions of Windows.

In XP/2003, enabling it would look like

bootcfg /ems on /port com1 /baud 9600 /id 1

On Windows Vista/2008+ it is enabled by typing the following command where {default} is the OS entry in BCDedit:

BCDedit /bootems {default} ON

The following commands set the global EMS redirection settings to use COM2 and a baud rate of 115200, and enable EMS for the specified boot entry.

bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200

Something that not many people know is that you can still connect to a Windows computer using EMS and perform a few administrative functions even after the computer has experienced a STOP/bugcheck/BSoD!

Powershell? I don't know about that... I kinda' doubt it, but who knows. The envisioned usage for EMS is after everything else has failed, but you can get a cmd.exe shell with EMS... and you can type powershell.exe from a Cmd.exe shell... so maybe.

That's the best Microsoft-native thing you're gonna get. Otherwise you are looking at third-party software for running a server over a COM or USB port.

The book Windows Server 2008 R2 Secrets By Orin Thomas has a decent section on EMS, which is actually freely Googlable.

Edit: Verified, Powershell is possible through EMS!

PS: You're nuts!

share|improve this answer
    
Sweet! Nice to know how to do it. Here's what it looks like: gist.github.com/Supermathie/7423949 –  MikeyB Nov 12 '13 at 1:44
    
Awesome. I've never seen EMS used in a production environment. Only by kernel debuggers and device driver writers have I ever seen it used. But more power to you! I'd upvote this question twice if I could. :) –  Ryan Ries Nov 12 '13 at 1:48
    
I'm a bit gobsmacked that there's no "just a serial console" option in EMS. That would be useful. –  MikeyB Nov 12 '13 at 15:06
    
Well, Windows doesn't really have a command line in normal operations. It doesn't have runlevels like Unix. It is GUI to the core. –  mfinni Nov 12 '13 at 20:28
2  
@mfinni Not entirely true in today's module-based Windows. Look at Server Core or Hyper-V Server (the standalone free hypervisor). Windows is pretty lean and slowly pulling away from GUI dependence thanks to PS. –  Ashley Steel Nov 12 '13 at 21:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.