A way is with Win32_UserAccount
How list the active users in a windows machine (for whom registry hive has been created) through code (c#/c++)
I am looking for a way to list all the user's SID this can be local/domain users that has logged in to the system at a point. I am specifically interested in users accounts that can be actually logged in through UI, the caveat here being that for domain users i only need the account that has already been logged into and a registry inside the USERS hive exists for the particular domain account.
I have already tried NetUserEnum, but i am failing to accomodate all the said conditions into it.
As a workaround i have also found the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList that has the subkeys as these users that i require, but i was intrested in knowing if any documented API or such exisits for the same.
Yes, access the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileListusing Registry API. Or you can try the ways which Castorix31 answered and also works fine. I haven't found other ways that can do this. Please kindly mark answer for completion of the question.
Sign in to comment