Current domain that the user is logged in into
-
I am trying to obtain the SID of the user currently logged in. I obtain the user name using GetUserName, and then the SID using LookupAccountName. This works, however the documentation of LookupAccountName says I must pass the "domain_name\user_name" for the lpAccountName parameter. Does anyone know how to obtain the domain_name of the domain the user is currently logged in? thanks!
-
I am trying to obtain the SID of the user currently logged in. I obtain the user name using GetUserName, and then the SID using LookupAccountName. This works, however the documentation of LookupAccountName says I must pass the "domain_name\user_name" for the lpAccountName parameter. Does anyone know how to obtain the domain_name of the domain the user is currently logged in? thanks!
You can try reading the USERDOMAIN environment variable... People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks