Created
December 14, 2018 21:38
-
-
Save adamfortuno/d4e7538ebce1d13703651ef36a6d947c to your computer and use it in GitHub Desktop.
Retrieve the IP address for a list of servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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