I needed to find an available domain controller in order to remote Powershell and use some AD modules. Didn’t want to start installing them on random machines. So how to find a DC? If you RDP, you can just write the domain name and it finds the first available DC. However that didn’t work for my PSSession, so what to do.
Turns out there was a neet oneliner for that 🙂
Returns the IP Adress of the first available DC, which works, but not so good. As it’s impossible to use Kerberos when using IP, well this can be turned into host name also in a one liner:
Gotta love great colleagues !