Hi wick.kwan,
There is no need to exit the domain to rename the computer. We could refer to the following script to change the computer's name.
Rename the local computer:
Rename-Computer -NewName "Server044" -DomainCredential Domain01\Admin01 -Restart
Rename a remote computer:
Rename-Computer -ComputerName "Srv01" -NewName "Server001" -DomainCredential Domain01\Admin01 -Force
Regards,
Rita
"WSUS" forum will be migrating to a new home on
Microsoft Q&A!
We invite you to post new questions in the "WSUS" forum's new home on
Microsoft Q&A!
For more information, please refer to the
sticky post.
Please remember to mark as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.