Created
August 8, 2016 19:00
-
-
Save davops/080b8e1e7a6674aa3f96fde42d217a0f to your computer and use it in GitHub Desktop.
Converts a server's DNS name to an IP address using the IPv4 address.
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
$dnsServer = "Server1.domain.com" | |
([System.Net.Dns]::GetHostAddresses($dnsServer) | where {$_.AddressFamily -eq 'InterNetwork'}).IPaddressToString |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment