Rename Your PC with Rename-Computer
Change the Windows computer name from PowerShell in one command instead of digging through Settings.
01Command
$ Rename-Computer -NewName "DESK-OFFICE-01" -Restart02What it does
The computer name is what appears on networks, remote-desktop lists, and backup dashboards, so home offices and small offices often want something readable instead of DESKTOP-RANDOMKEY. Rename-Computer sets the NetBIOS name, prints a confirmation with the old and new values, and accepts -Restart to apply it in one step. Without the restart, the new name only takes effect at the next reboot, and other machines keep seeing the old name until then. Omit -Restart if you want to rename now and reboot later at a convenient time.
03Risk
04Undo
$ Rename-Computer -NewName "OLD-NAME" -Restart05Sources
- Rename-ComputerEvidence: Documents Rename-Computer -NewName and the -Restart switch; notes a reboot is required for the change to take effect.
Last verified: 2026-09-18 · Category: System & Settings
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.