Command Line Terminal Services

I love doing things from the command line; if nothing else, it lends itself to automation.  Here are a few tips and tricks.

Does Terminal Services Allow Command Line Sessions?

No, yes, and sort of - it depends on what you want to do.

No, there is not a command-line logon and session interface for terminal services.

Yes, you can have  a remote command line session on a Windows 2000 Terminal Server.  Turn on the built-in Telnet service.

The somewhere-in-between alternative is to use the capacity planning tool called smclient.  It can be scripted and does an excellent job of screen-scraping glyphs ("glyphs" are various text symbols displayed onscreen, including text in console windows, title bars, and icon names).

Can I Install Terminal Services from the Command Line?

Yes; see the Clues on Installing Windows 2000 Terminal Services page.

Disable/Reenable Terminal Services

This can be done through a call to the Terminal Service component install file, without requiring install or uninstall.

To disable Terminal Services:

%SystemRoot%\System32\rundll32.exe setupapi,InstallHinfSection TerminalServices.ToggleOff 128 %SystemRoot%\inf\tsoc.inf

To re-enable Terminal Services:

%SystemRoot%\System32\rundll32.exe setupapi,InstallHinfSection TerminalServices.ToggleOn 128 %SystemRoot%\inf\tsoc.inf

What Are The Terminal Services Console Tools?

They vary depending on version and configuration; many apply to XP as well.  I ahve a summary list of the Terminal Server Console Commands which was pulled from a Windows 2000 Terminal Server in Application mode.