Everything I’ve read online about this topic always contains how to look up multiple IP’s from a single name server. I’m looking to do the opposite to test conditional forwarders on multiple domain controllers. The script I have tests the URL against an array of domain controllers, and it works. I’m trying to figure out how I can output which DC failed to resolve when it errors. Any suggestions?
clear $URL = "URL" $NameServers = @("Domain Controller 1", "Domain Controller 2", "Domain Controller 3", "Domain Controller 4") foreach ($NameServer in $NameServers){ Resolve-DnsName -Name $URL -Server $NameServer }