So I have to use batch only for this. Basically, the server HOSTNAMES are all listed in a txt file. I used the following code to ping all the servers and di
Try this
$servers = Get-Content test.txt $reg="" foreach ($server in $servers) { $reg=$reg+$server+"`t"+([System.Net.Dns]::GetHostAddresses($server) | foreach {echo $_.IPAddressToString})+"`n" } $reg >reg.csv