Is there a native Win32 API to look up a User Right Display Name?

Viewed 95

I am enumerating all the User Rights that can be found in a Group Policy under "Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\User Rights."

Some examples of these rights in the Group Policy Management Editor are "Access Credential Manager as a trusted caller" and "Access this computer from the network."

When you configure these settings, the corresponding GptTmpl.inf file for that GPO is updated with the actual name of the right or privilege.

The two mentioned above are

  • SeTrustedCredManAccessPrivilege
  • SeNetworkLogonRight

In my code I am using LookupPrivilegeDisplayName to get the display name of each privilege. However, it fails when I get to a "right"

[DllImport("advapi32.dll", SetLastError = true)]
       public static extern bool LookupPrivilegeDisplayName(string systemName, string privilegeName, StringBuilder displayName, ref uint cbDisplayName, out uint languageId);

I have not been able to find an API that can lookup the display name of a user "right." However, somehow, the GPMC is able to display them. Is there an equivalent to LookupPrivilegeDisplayName for user rights?

0 Answers
Related