KixKicks,

Please log the error returned from the WMI call, something like
 Code:
If @ERROR
  'WMI:' + @ERROR + ' / ' + @SERROR + @CRLF
EndIf
Let me know what error is being returned. I've recently (past 6 weeks) seen issues with WMI calls - scripts that have been in place for over 10 years have suddenly started throwing weird errors when invoking WMI. Specifically, I've been getting error 9 returned. Again, it's a few systems, not all. A reboot will help, and sometimes restarting the WMI services one or more times will help as well. We're using Kix 4.62 in production.

The WMIQuery code hasn't changed since 2009 and was originally written in 2001 (and - it's Radimus' UDF, I just added the authentication logic ;\) ). Since we haven't seen issues with the code in all that time, I have a feeling that something changed in Kix itself, or with a recent O/S patch.

Can you try running with Kix 4.53 on one of the problem systems and see if the problem persists? That would help narrow things down to Kix.

Also, using this UDF in a login script might not be the best method. This UDF instantiates the connection for each individual query, which can take a fair amount of time. For example, my login script completes a dozen mappings in seven-eighths of a second, a single call to WMIQuery can take 400ms or more. I found this when I called WMIQuery just nine times in a script. Rewriting the code to instantiate the WMI object and then make the 9 queries in sequence in the single UDF completed all queries in about 550ms compared to over 3.5 seconds! Look at my WMINicInfo UDF for an example - the top half of the UDF should look familiar!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D