Recently I needed to be able to securely, remotely manage a set of Windows Servers that were not domain joined. One problem that I hit while setting this up was that each of the servers did not believe that they had a valid FQDN.
For example – I could:
- Set the name of a computer to “HyperVSV1”
- Create a DNS entry that said that “HyperVSV1.mydomain.com” resolved to that computer
- I could then correctly ping the computer at that address
But when I tried to use tools like PowerShell Remoting or Remote Desktop – they would complain that “HyperVSV1.mydomain.com” did not believe it was “HyperVSV1.mydomain.com”.
Thankfully, this is relatively easy to fix.
If you open PowerShell and run the following two commands:
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" -Name Domain -Value "mydomain.com"
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" -Name "NV Domain" -Value "mydomain.com"
After this your workgroup server will correctly identify itself with a valid FQDN.
Cheers,
Ben
Very helpful, thanks! I was wondering if there’s an easy way to resolve the certificate warning for ages.
For a more “high level” solution, I’ve been using this (for more years than I would like to admit) to rename a computer and set its FQDN:
$hostname = ‘HyperVSV1’
$domainname = ‘mydomain.com’
netdom renamecomputer $env:COMPUTERNAME /newname:$hostname /force
netdom computername $env:COMPUTERNAME /add:”$hostname.$domainname”
netdom computername $env:COMPUTERNAME /makeprimary:”$hostname.$domainname”
But I would love if someone could point to a simpler solution. Preferably in “pure” PowerShell.
Unfortunatelly Rename-Computer doesn’t cut it. It really should have an argument for this (-NewDomainName?).