Renaming and Terminal Services in Server Core

I thought for today’s post I would cover some of the top questions I get on how to do something on Server Core. In coming weeks I’ll expand this into some of my favorite command line tools.

 

First up is how to rename the box, since there isn’t a remoteable gui to let you do this. This is straightforward if you are domain joined:

Netdom renamecomputer %computername% /NewName:new-name /UserD:domain-username /PasswordD:*

But netdom doesn’t currently provide a way to rename a non-domain joined computer. It is a bit of a hassle to join and unjoin from a domain just to rename the computer. WMI is the solution to this one. Using WMIC you can rename the computer using:

wmic computersystem where name="%computername%" rename name="new-name"

The one limitation to this is that it must be run while logged on with the default administrator account.

 

Terminal Services is another common topic. A lot of people think that since there is no shell you can’t TS into Server Core. However, Server Core does include TS remote admin mode, when connected you just have the same experience as if you were logged on locally, a cmd.exe window. TS remote admin mode is not enabled by default and it is another one of those things that is only available in a non-remoteable gui. For this one, we included a script that can be used to turn it on and off, turning it on is done by running:

Cscript \windows\system32\scregedit.wsf /ar 0

Terminal Services by default in Longhorn Server uses a new higher security mode that only allows Vista and Longhorn Server clients to connect. If you want to TS to your Server Core box from a pre-Vista\Longhorn Server Terminal Services client, you need to turn off the higher security mode, which can be done by running:

Cscript \windows\system32\scregedit.wsf /cs 0

Once enabled you can then use the TS MMC snap-ins to remotely manage TS on the Server Core box, or use the TS command line tools. For example, since there is no Start menu to select logoff to end your TS session, you can use the logoff.exe command line tool.

 

If you are ever trying to find a command line tool to do something, check out the “Command-line reference A-Z” at: https://go.microsoft.com/fwlink/?LinkId=20331. This is from Windows XP/Windows Server 2003 help so doesn’t have any of the new Longhorn tools or switches, but it is a useful place to start.

 

Andrew