Get IP address and DNS of remote computers

$Computers = GC “c:\temp\servers.txt”

foreach($computer in $computers)
{
Get-WMIObject Win32_NetworkAdapterConfiguration -Computername $Computer | Where-Object {$_.IPEnabled -match "True"} |
Select-Object -property DNSHostName,@{N=”DNSServerSearchOrder”;
E={“$($_.DNSServerSearchOrder)”}},
@{N=’IPAddress’;E={$_.IPAddress}}|export-csv c:\temp\DNSlist.csv -NoTypeInformation -append
#@{N=’DefaultIPGateway’;E={$_.DefaultIPGateway}}
}

16 Comments

  1. What i do not understood is actually how you are not really a lot more smartly-liked than you might be now. You’re so intelligent. You understand therefore significantly in relation to this subject, made me for my part imagine it from a lot of various angles. Its like men and women aren’t fascinated until it is one thing to accomplish with Lady gaga! Your own stuffs outstanding. All the time deal with it up!

  2. I’ll right away grab your rss feed as I can’t find your email subscription link or newsletter service. Do you have any? Kindly let me know in order that I could subscribe. Thanks.

Leave a Reply

Your email address will not be published.