Remotely rename a PC with Powershell

powershell window box
Do you need a quick and easy way to rename a computer that is joined to a domain remotely via Powershell? 

1. Enable "Windows Management Instrumentation" and "Remote Management" rules on your computers firewall. This can be done via Group Policy for multiple computers.
Note: If you don't enable WMI rules, you may get an error such as "Cannot establish WMI connection to computer. RPC server is not available."
2. Open cmd as an administrator and type powershell
3. Rename-computer –computername “testpc” –newname “newtestpc” -localcredential domain\user –domaincredential domain\user –force -passthru –restart

This command renames the testpc computer to newtestpc and then restarts it to make the change effective.
It uses:
- The localcredential parameter to supply the credentials of a user who has permission to connect to the local computer.
- The domaincredential parameter to supply the credentials of a user who has permission to rename computers in the domain.
- The force parameter will suppress the confirmation prompt.
- The passthru parameter will return the results of the command.

By the way have you seen the RAVPower FileHub? It's a travel Router with wifi AC750 300Mbps Wi-Fi on 2.4Ghz or 433 Mbps on 5Ghz. It includes an SD Card Reader, 6700mAh Battery and can connect an SSD hd. Make this a portable NAS to store your pics and videos or upload your SD card pics/videos to a SSD hd. This is a bargain for under $60. (Amazon USA Link)

Did our article help you? Here are some ways you can help us.

Have a look at our IT Tech Tool Kit List, need ideas on what to buy? I have listed my top 29 tools here.

Buy me a coffeeBuy me a coffee

Rating: 5.0/5. From 1 vote.
Please wait...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.