I’m sure many people are experimenting with VMs and SQL Server. If you’re like me, many of you just default to installing Windows 7/10 or Windows Server xx Standard for your testing. Those systems work fine, but I’ve been trying to build slimmer systems, which means looking at Server Core. Installing Server Core is much the same as other versions, though you end up with only a command line. If you’re like me, using VMWare, you also might end up with a server name like “WIN-LKR3R4FfL5T”.
I want to change that. It’s a fine name if I’m working locally. It’s not to much fun connecting across a network. This post looks at how to rename that machine.
Get the Name
The first thing is to get the name. I’ve always just right clicked the Computer in Explorer, but that’s not possible in Core. Instead, I decided to use PowerShell, since I know how to do that.
First, start PowerShell, which is simple.
Next, use the environment variable, $env:computername, to find the name. You can see me do that here:
Technically I don’t need the name to rename the system, but I wanted to know what it was. Plus, I’ll want to verify things work. There is a cmdlet, Rename-Computer, that does exactly what you’d expect. It renames a machine.
There are various parameters, but the only one I really need is “NewName”. I haven’t joined a domain yet, so no reason to worry about that security. I could include the Restart parameter, but I wanted the screenshot below.
That’s really it, other than a restart. Intuitively enough, Restart-Computer works fine.
And on restart, I log in and can see my rename worked fine.
Now, on to SQL Server installation.