.netwindowssecurityrights

Is there a way to check if a user has specific rights?


In my application I'm using ntrights.exe, that is part of Windows Resource Kit, to grant and revoke a specific user right.

For example to grant a user "Log on as a server" right, I execute using shell object following command:

ntrights -u User +r SeServiceLogonRight

However ntrights doesn't allow you to check if a user has a specific right.

Can you tell me how I can check if a user has a specific right?

Update The question is posted here because it's part of .NET application I'm writing. If any one knows, how to do it using code, please post it here.


Solution

  • Short answer: LsaEnumerateAccountRights (see also).

    I don't know if .NET provides a wrapper class, though.