Powershell script for pinging computers from a text file and displaying output with ip address

i am currently using the following script to display the computers that are pinging, i also want the script to display the ipaddress along with the results but the results are displayed not properly, i want the result to be displayed in a table or list format, what am i missing?

$ServerName = Get-Content "C:\scripts\computers.txt" foreach ($Server in $ServerName) { if (test-Connection -ComputerName $Server -Count 2 -Quiet) { "$Server is Pinging " } else {"$Server not pinging" } } foreach ($server in $servername) { Get-WmiObject -class "Win32_NetworkAdapterConfiguration"|Select-Object IPAddress|Format-List }


  • Changed type sa141 Friday, February 06, 2015 9:00 PM
  • Edited by sa141 Friday, February 06, 2015 9:01 PM
February 6th, 2015 8:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics