9/24/15

Invalid DNS server prevents RDP connections

A headless Hyper-V core server in my lab wouldn't accept RDP connections because it couldn't authenticate the incoming username due to an invalid DNS configuration on its NIC.

Connecting a monitor and keyboard would've been too easy

A remote Powershell session (authenticated as the server's local administrator) worked...

Enter-PSSession -ComputerName COMPUTER -Credential USER

...but sconfig wouldn't run.

Fear not, you can see your entire network configuration by running netsh dump.  To set the primary DNS server to 1.1.1.1 on my Server 2012 R2 host with a network interface called "vEthernet (External_Internal)":

netsh interface ip set dnsservers "vEthernet (External_Internal)" static 1.1.1.1 primary