Home
> PowerShell Scripting > resolving hosts to ip addresses in bulk
resolving hosts to ip addresses in bulk
Quick and easy Powershell script to resolve servers in a text document to ip addresses:
I’m using h:\book1.txt as my source in this case, change this for the textfile you wish to query.
$servers =@()
$servers += get-content h:\book1.txt
foreach ($server in $servers){
$ip = [System.Net.Dns]::GetHostAddresses(“$server”)
write-host $server – $ip
}
Voila! (this will also work in reverse)
Categories: PowerShell Scripting
PowerShell
Comments (0)
Trackbacks (0)
Leave a comment
Trackback
Recent Comments