The wmi authentication was integrated with the query last month. no need for a separate authentication call.

Personally, I like to add little print statements - even just " '.' " every couple of lines to see the progress. Even better is printing out vars and major decision points - not so much to debug the UDF (this should already be done) but to debug the arguments I'm passing to it and to make sure it's interpreting the data correctly!

I'd follow Radimus' recommendations - start close and work your way more complex.

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