Rename Your PC with Rename-Computer

Change the Windows computer name from PowerShell in one command instead of digging through Settings.

Windowsaccountscomputer-namepowershellLow risk
Run Rename-Computer -NewName "NEW-NAME" -Restart in an elevated PowerShell to rename the machine and reboot immediately.

01Command

Command
$ Rename-Computer -NewName "DESK-OFFICE-01" -Restart

02What 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

RiskLow risk
RequirementsPowerShell as Administrator
!Warning: Renaming requires a restart, and domain-joined machines should be renamed with domain admin coordination so the computer account follows.

04Undo

Undo
$ Rename-Computer -NewName "OLD-NAME" -Restart

05Sources

  • Rename-Computer
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: 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