All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI Query to determine if Object is a Computer? Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I want to write a WMI query that would 1) Ping the object. (Ping should be silent, not with the command window popping up) If Ping is successful 2) Check to see if the object is a computer, printer or router? Based on the results, generates 3)IP Address of object, hostname 4) Finally write in a log file - That I can take care of.
I am assuming that "item.SystemType" will identify the object whether it is a Printer, Computer or Router.
Does "item.Status" only identify if object is on the network or not. Then in that case, will I still need to ping the object to check if it is active on the network or not?
Eg. My machine is on the network but it might be turned off. If I run the query on that object, will it still return enabled..coz it is on the network...even though it is off.
Just want to make sure that would I still need to add ping query or "item.Status" should suffice.
You do need to ping it (or use any other methods you can think of to determine whether it is active on the network or not).
However, if the remote computer is offline, System object will return empty (or null). So you can use that for your cause as well. Simply add an IF statemenet to determine the object type.