Skip to content

Instantly share code, notes, and snippets.

@adamfortuno
Created December 14, 2018 21:38
Show Gist options
  • Save adamfortuno/d4e7538ebce1d13703651ef36a6d947c to your computer and use it in GitHub Desktop.
Save adamfortuno/d4e7538ebce1d13703651ef36a6d947c to your computer and use it in GitHub Desktop.
Retrieve the IP address for a list of servers
$servers = @(
'foo1.sandbox.local'
'foo2.sandbox.local'
'foo3.sandbox.local'
)
foreach ($server in $servers) {
"{0}`t{1}" -f $server, [System.Net.Dns]::GetHostAddresses($server).IPAddressToString
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment