I been using a nice VBA script from M$ to ping computer my building.
PHP Code:
DOWN_MSG = " is not reachable." ' message for an unsuccessful ping
UP_MSG = " is online." ' message for a successful ping
Function Pinger (machine)
aMachines = split(machine, ";")
For Each machine in aMachines
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '"_
& machine & "'")
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
pinger = machine & DOWN_MSG
Else
pinger = machine & UP_MSG
End If
Next
Next
End Function
Right now, my output is Machine is Up or Machine is Down.
I'm looking to get the IP address of a specific machine also but I cannot found the IP Address propriete in the ObjStatus objet. Anyone can help?