change hostname of windows server 2019 powershell code example Example: powershell change hostname Rename-Computer -NewName 'SomeHostname' -Restart