I needed to quickly get the IP addresses of about 100 servers from their names. I pasted all the servers into a text file, one per line, and ran the following loop:
$servers = Get-Content .\serverList.txt $ping = New-Object System.Net.NetworkInformation.Ping foreach($s in $servers) { $("$s,$($ping.Send($s).Address)") }
This loop outputs a comma delimited list of ServerName,IP to the window like this:
TEST-SF6,10.12.3.96
W2003TEST,10.1.34.80
W2003TEST2,10.8.51.27
I pasted the list into a new email in Outlook, highlighted it, and then used the Convert Text to Table feature in Word (and Outlook):
Word turned my pasted CSV list into a nice table and I sent it off.