Hoping this is an easy one...
I have a script that I am using to query Windows machines for Hotfixes. I am running it as domain admin. When it connects to a machine, I get the data I am looking for. But, if it hits a machine that is down (I verify with a ping), I get "WMI Connection failed" errors and then it stops.
I have a warn statement in there but it does not continue.
Here is the relevant data in the script.(The script itself is HUGE as it does some munging at the end before it writes to a file)
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\ro
+ot\\CIMV2") or warn "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_Quick
wbemFlagReturnImmediately | wbemFlagForwardOnly);
Can anyone help me get past these errors?