the weird hex @error statements were pointed out to me to convert WMI or COM error numbers into the equivalent Kix error code values.

personally, I;d just pull all the error trapping out, except for just before the the for each statement. I typically don't need to know why it failed, just that it did. since that I know that this UDF is pretty much 100% if there is a problem it is usually with the OS on the target machine.
However, since putting in the authentication model, there is a point of failure, so that only leaves 1 possibly unnecessary statement, so it may as well be left in.

if It all works and tests out, I may Lonk it and strip all the vars down to 2 chars and make it completely unreadable, but more compact. I am quite proud of this line:
$tmp = $tmp +'|' + iif(VarType($sValue) & 8192,join($sValue,'|',ubound($sValue)),$sValue)
_________________________
How to ask questions the smart way <-----------> Before you ask