netdom renamecomputer
The netdom renamecomputer command renames a domain workstation or member server and its corresponding domain account. Windows commands reference
On Windows
Windows
The netdom renamecomputer command renames a domain workstation or member server and its corresponding domain account. It's available if you have the Active Directory Domain Services (AD DS) server role installed. It's also available if you install the AD DS tools that are part of the Remote Server Administration Tools (RSAT). For more information, see How to Administer Microsoft Windows Client and Server Computers Locally and Remotely. To use netdom renamecomputer, you must run the command from an elevated command prompt.
netdom renamecomputer machine /NewName:new-name[/UserD:user [/PasswordD:[password | *]]][/UserO:user [/PasswordO:[password | *]]][/Force] [/Reboot[:Time in seconds]][/SecurePasswordPrompt]
To rename the member server MyServer to MyNewServer, run the following command
netdom renamecomputer MyServer /newname:MyNewServerIdentify/newnameSpecifies the new name of the computer. Windows commands reference<machine>Specifies the name of the computer that you want to rename./newname:<NewComputerName>Specifies the new name of the computer./userd:<User>Specifies the user account that you want to use for the destination domain./passwordd:<Password> \* Specifies the password of the user account that you specify using the /userd parameter. If you specify the value of this parameter as a wildcard character (*), this parameter prompts you for the password./usero:<User>Specifies the user account that you want to use for the originating domain./passwordo:<Password> \* Specifies the password of the user account that you specify using the /usero parameter. If you specify the value of this parameter as a wildcard character (*), this parameter prompts you for the password./forceWhen the /force parameter is specified, you aren't prompted for confirmation to rename a device./reboot:<seconds>Shuts down the computer and automatically reboots after the move operation completes. The seconds value is the number of seconds before automatic shutdown. The default is 20 seconds./securepasswordpromptOpens a secure credentials popup for entering credentials. This is useful when specifying smartcard credentials. This option is effective only when the password is entered as *.help \/? Displays help at the command prompt.