User Tools

Site Tools


computing:windows:rename_pc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:windows:rename_pc [2018/04/10 12:02]
gcooper
computing:windows:rename_pc [2021/09/14 10:54] (current)
gcooper
Line 10: Line 10:
 wmic computersystem where caption='currentname' rename 'newname' wmic computersystem where caption='currentname' rename 'newname'
 </file> </file>
 +
 +Then reboot to activate the new hostname:
  
 <file> <file>
-netdom renamecomputer %COMPUTERNAME% /Newname "NEW-NAME"+shutdown -r -t 0
 </file> </file>
  
-Windows 2008/2012:+WHS script:
  
 <file> <file>
-netdom renamecomputer "$env:COMPUTERNAME/Newname "NEW-NAME" +Set objWMIService = GetObject("Winmgmts:root\cimv2")
-</file>+
  
-Then reboot to activate the new hostname:+For Each objComputer in _ 
 +    objWMIService.InstancesOf("Win32_ComputerSystem")
  
-<file> +    objComputer.rename "NewComputerName", NULL, NULL  
-shutdown -r -t 0+Next
 </file> </file>
computing/windows/rename_pc.1523383321.txt.gz · Last modified: 2018/04/10 12:02 by gcooper