Skip to content

Instantly share code, notes, and snippets.

@tonejito
Created August 12, 2016 17:23
Show Gist options
  • Select an option

  • Save tonejito/c02b0f7fa602ea18595177f9fb9a3954 to your computer and use it in GitHub Desktop.

Select an option

Save tonejito/c02b0f7fa602ea18595177f9fb9a3954 to your computer and use it in GitHub Desktop.
Rename Windows PC via PowerShell and WMI
# Rename Windows PC via PowerShell and WMI
# http://social.technet.microsoft.com/wiki/contents/articles/7824.set-computer-name-using-powershell.aspx
# https://technet.microsoft.com/en-us/library/hh849792(v=wps.620).aspx
$ComputerName = Get-WmiObject Win32_ComputerSystem
$ComputerName.Rename($name)
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment