Don't forget though that you may want to PING them first and also check that WMI is working before running it.

There is a ConfirmWMI() UDF for that in the UDF forum.

and Les has not posted this as a UDF yet, but works fairly well for pinging the systems.

Code:

Function Ping($PC)
Shell'%comspec% /c ping -n 1 '+$PC+' >nul'
$Ping = NOT @error
EndFunction


 


Edited by NTDOC (2006-01-26 02:37 AM)