Reputation: 81
I've only been able to find an answer to the need for AdministatorRights here, and so I ask for help on this one. I hope I didn't miss an answer elsewhere, I truly apologize if I did.
Anyhow, I'm trying to write a simple program to search for the rights of the user.
I planned to iterate through the list and return the rights of the user, but I hit a road bump in that there is no method, as far as I see, to check if a user has the given privilege. I've been able to find information on attempting to change the status of the user rights, but not a simple call to see if they are enabled or disabled. Does anyone know a way around this method? I'm a bit stuck in how to achieve this, any help is greatly appreciated!
Thanks!
Upvotes: 3
Views: 2269
Reputation: 5279
You can use LsaEnumerateAccountRights
, but it only seems to report what rights are assigned specifically to that account and does not include the rights that are conveyed via group membership.
Upvotes: 0
Reputation: 36318
Just use GetTokenInformation
with the TokenPrivileges
option.
You can use OpenProcessToken
or OpenThreadToken
to get a handle to the access token you want to query.
Upvotes: 2