This script will let you query servers on your domain network for DNS server settings and return them in the CSV file.
Script takes text file containing server names:
server1 server2 server3
and returns CSV file with Hostname, DNS Servers, IP Addresses settings
Get-Content .\servers.txt | `
ForEach-Object {
Get-WMIObject Win32_NetworkAdapterConfiguration -Computername $_ | `
Where-Object {$_.IPEnabled -match "True"} | `
Select-Object -property DNSHostName,@{N="DNSServerSearchOrder";
E={"$($_.DNSServerSearchOrder)"}},
@{N='IPAddress';E={$_.IPAddress}}
} | Export-CSV -path servers.csv -NoTypeInformation
Full list of properties you can query using Win32_NetworkAdapterConfiguration class is available at:
http://msdn.microsoft.com/en-us/library/aa394217%28VS.85%29.aspx


this doesn’t check for servers that are offline. It terminates with an error as soon as it finds a server that it can’t connect.
[...] simple script will do the work. The source I found on this web site and changed it for my [...]