Retrieving Domain of Logged in user
Posted on 2003-03-14
After countless searching I still can't find the answer.
The problem is this. I am writing a VB program that needs to know who the user is that is logged into windows. I can get the username just fine using the Windows API GetUserNameA, however I need the domain name of the account also. The GetUserNameA only returns the Username of the account. The domain is necessary part so the program can run properly since it will connect to a SQL database using Windows NT authentication.
Only requirement, can not use Windows Scripting Host, since the exe will be ran from a network directory I can not take the chance on whether or not the machine has WSH installed (or some other non common DLL).