Change the computer name
Use the Get-ChildItem cmdlet to get the computer name.
Get-ChildItem ENV:\ComputerName
Use the Rename-Computer cmdlet to rename the computer.
Rename-Computer –Newname "computer name"
As you can see there is a warning asking to restart the computer.
At this point it’s a good idea to change the Primary DNS suffix of the computer. So do it before restarting the computer.
Use the Set-ItemProperty cmdlet to set the primary DNS suffix.
Set-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\” –Name Domain –Value "domain name"
As you can see the registry is modified here.
Now you can restart the computer.
Use
shutdown/r
You can check the result with
ipconfig /all
Cheers 🙂
Leave a comment