Change the computer name

Spread the words

Change the computer name

Use the Get-ChildItem cmdlet to get the computer name.

Get-ChildItem ENV:\ComputerName

getcomputername

Use the Rename-Computer cmdlet to rename the computer.

Rename-Computer –Newname "computer name"

renamecomputer

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"

primarysuffix

As you can see the registry is modified here.

suffixregistry

Now you can restart the computer.

Use

shutdown/r

You can check the result with

ipconfig /all

ipconfigall

Cheers 🙂

Leave a comment

Your email address will not be published.


*