To rename computers in a domain:
netdom renamecomputer currentcompname /newname:newcompname /usero:domain\adminname /passwordo:* /userd:domain\adminname /passwordd:* /force /reboot:10
Drop off the /reboot if you want the change to happen the next time the computer is rebooted (and not immediately). So it would be:
netdom renamecomputer currentcompname /newname:newcompname /usero:domain\adminname /passwordo:* /userd:domain\adminname /passwordd:* /force
PowerShell v5 has a new way of renaming computers found here: https://technet.microsoft.com/en-us/library/hh849792.aspx
Here is the command for the local computer:
Rename-Computer -ComputerName . -NewName <New name>
But if I wanted to rename a local computer, I would just do it graphically. The point is to rename a remote computer.
Rename-Computer -NewName Server044 -DomainCredential Domain01\Admin01 -Restart