Windows VPS & RDP

Rename your Windows server computer name

Give your Windows VPS or Admin RDP a clear computer name with PowerShell or System Properties, and fix what can break afterwards, such as SQL Server and certificates.

BeginnerWindows server4 min read

New Windows servers often come with a random name such as WIN-8F3K2LQ7ABC. A clear name, such as web01 or trading-vps, makes logs, Remote Desktop tabs and backups easier to read. Renaming takes one command and a restart, but a few apps remember the old name, so this guide also covers what to check afterwards.

Before you start

  • Administrator access over Remote Desktop to 203.0.113.10:3389.
  • A good time for a restart. The new name only applies after a reboot.
  • A new name that follows the rules:
  • 15 characters or fewer.
  • Letters, numbers and hyphens only. No spaces or underscores.
  • Not only numbers.

Warning: Renaming requires a restart. Close running apps, such as trading terminals, and save your work first.

Check the current name

In PowerShell:

PowerShell
$env:COMPUTERNAME

Or run hostname in any command window. Note the old name. You will need it if SQL Server is installed.

Rename with PowerShell

Open PowerShell as Administrator and run:

PowerShell
Rename-Computer -NewName "web01" -Restart

-Restart reboots straight away. Your Remote Desktop session drops. Wait two to three minutes, then reconnect to 203.0.113.10:3389.

To rename now and restart later, leave off -Restart. Windows shows a warning that the change takes effect after the next restart. Restart when you are ready:

PowerShell
Restart-Computer

Rename with System Properties

  1. Press Win + R, type sysdm.cpl and press Enter.
  2. On the Computer Name tab, click Change.
  3. Enter the new name in Computer name and click OK.
  4. Click OK on the restart notice, then Close.
  5. Choose Restart Now, or Restart Later if you need to finish something first.

On Windows Server you can also click the computer name under Local Server in Server Manager, which opens the same window. On Windows 10 or 11, Settings → System → About → Rename this PC does the same thing.

What the rename affects

Most apps do not care about the computer name. These do:

SQL Server

SQL Server stores the computer name it was installed under. After a rename, connections by the new name usually work, but @@SERVERNAME still returns the old name. That can break replication, maintenance plans and some jobs.

Check it in SQL Server Management Studio or sqlcmd:

SQL
SELECT @@SERVERNAME AS stored_name, SERVERPROPERTY('MachineName') AS machine_name;

If the two differ, update the stored name. For a default instance:

SQL
EXEC sp_dropserver 'OLDNAME';
EXEC sp_addserver 'web01', 'local';

For a named instance, such as SQL Server Express, include the instance name: 'OLDNAME\SQLEXPRESS' and 'web01\SQLEXPRESS'. Then restart the SQL Server service. Connection strings in your apps that use the old name also need updating.

Certificates

Certificates issued to the old computer name will not match the new one. This affects:

  • Remote Desktop: expect a fresh certificate prompt the first time you connect after the rename. Accept it if the IP is yours. If you installed your own trusted RDP certificate for a hostname, it is not affected by the computer name.
  • Internal certificates for apps that use the machine name, such as some web services. Reissue them with the new name.

Public certificates for a domain, such as example.com on IIS, are tied to the domain, not the computer name, so they keep working.

Other apps

  • Licence managers and some trading or monitoring software bind licences to the computer name. Check with the vendor before renaming a licensed machine.
  • Scripts, scheduled tasks and shortcuts that use \\OLDNAME\share paths need updating.
  • Backup software may treat the renamed server as a new machine.

Check it works

After the restart, reconnect over Remote Desktop and run:

PowerShell
$env:COMPUTERNAME

It should show the new name. If SQL Server is installed, run the @@SERVERNAME query again and confirm both columns match.

Troubleshooting

  • "Skip computer rename because the new name is the same": the name is already set, or the rename is waiting for a restart. Restart and check again.
  • "The computer name is not valid": remove spaces, underscores and special characters, and keep it to 15 characters.
  • Can't connect after the restart: give Windows a few more minutes. If it still fails, open the browser console in your VPS provider's control panel to see whether Windows is still applying changes.
  • An app stopped working: look for the old name in its configuration file, connection string or licence. Event Viewer often names the exact error.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.