This shows you the differences between two versions of the page.
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=' | wmic computersystem where caption=' | ||
</ | </ | ||
+ | |||
+ | Then reboot to activate the new hostname: | ||
< | < | ||
- | netdom renamecomputer %COMPUTERNAME% /Newname "NEW-NAME" | + | shutdown |
</ | </ | ||
- | Windows 2008/2012: | + | WHS script: |
< | < | ||
- | netdom renamecomputer | + | Set objWMIService = GetObject("Winmgmts:root\cimv2") |
- | </ | + | |
- | Then reboot to activate the new hostname: | + | For Each objComputer in _ |
+ | objWMIService.InstancesOf(" | ||
- | < | + | objComputer.rename " |
- | shutdown -r -t 0 | + | Next |
</ | </ |