Radimus, I'm trying to use your code listed above to learn more about WMI. At this time I am having difficulty getting it to return a username of a logged on user to a W2K terminal server session on my W2K standalone server. Is this approach limited in its usage?

I copied your code and replace the server name in the function call:
WMIQuery("username","Win32_ComputerSystem","bullpup")

Although I have a current Terminal session to Bullpup nothing is returned. Can you shed some light on this?
_________________________
Home page: http://www.kixhelp.com/hb/