I found GetUserName api call should work for getting the user name. However, determining the current user's domain seems more problematic. I found the following approaches:
1. The environment variable UserDomain.
2. wscript.network com object, username & userdomain properties.
3. Get the SID for the current PID and call LookupAccountSID - this seems like the most reliable, but I'm not sure how to get from Application.ProcessID to SID through to LookupAccountSID.
In my test w/ a vfp com object running under COM+ services, UserDomain environment variable and the wscript.network object do not return the domain of the account that the com object is running under.
I've googled & searched UT, but haven't found all the pieces. I would appreciate if you have any insight and can point me in the right direction.
Best,
Mark Nadig
/\/\/