I run this script and I want it to tell me the name of the failed ping. Where “$computer is offline” is, I want it to show “pc2 is offline” or whatever pc fails the ping basically. Any ideas?
I really like the output and speed of Grahams edit of Nigel’s script! I wish it could show ipv4 and servicetag info as well. How would I pipe these into the script? Without the need for the txt/csv. Also I noticed it truncates the list of my ipv4 addresses with my original script which was annoying not to see the last octet of the contacted host. The last script listed seems to have a different list view output.
I got it to work by calling the CSV and pointing the foreach to it. The only issues I have are the truncating of the tables and after about 15 down the list is stalls and never moves to the next computer. I don’t see where I would specify the Devices to test-ping on without calling the csv though. Thanks Graham!
Actually after hanging a while it threw this and didn’t display the serial and loaded most of the rest of the list fine. So that’s the issue. May be worthy to note that the errors are only thrown in windows 7 workstations and none of the Servers had the error.
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At C:\Users\user\Desktop\ps\New Text Document (2).ps1:15 char:37
So i’ve amended the code to look at WMI class Win32_Bios for the serial number instead of, win32_SystemEnclosure. Win32_Bios might be more generic for you: