Collect the FQDN Name from a list of servers / Ip Addresses

Piece of cake. First build a txt file to read the content from then let the [system.net.dns]::Resolve methon do the trick.

$T=get-content(“badservers.txt”);foreach($S in $T) {$R=[system.net.dns]::Resolve($S);$R.Hostname

You can create an output file with the results adding:

$T=get-content(“badservers.txt”);foreach($S in $T) {$R=[system.net.dns]::Resolve($S);$R.Hostname | Out-File -append s.txt}

Bye.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s