LsaEnumerateAccountRights Function

The LsaEnumerateAccountRights function enumerates the privileges assigned to an account.

Syntax

C++
NTSTATUS LsaEnumerateAccountRights(
  __in   LSA_HANDLE PolicyHandle,
  __in   PSID AccountSid,
  __out  PLSA_UNICODE_STRING *UserRights,
  __out  PULONG CountOfRights
);

Parameters

PolicyHandle [in]

A handle to a Policy object. The handle must have the POLICY_LOOKUP_NAMES access right. For more information, see Opening a Policy Object Handle.

AccountSid [in]

Pointer to the SID of the account for which to enumerate privileges.

UserRights [out]

Receives a pointer to an array of LSA_UNICODE_STRING structures. Each structure contains the name of a privilege held by the account. For a list of privilege names, see Privilege Constants

When you no longer need the information, pass the returned pointer to LsaFreeMemory.

CountOfRights [out]

Pointer to a variable that receives the number of privileges in the UserRights array.

Return Value

If at least one account right is found, the function succeeds and returns STATUS_SUCCESS.

If no account rights are found or if the function fails for any other reason, the function returns an NTSTATUS code such as FILE_NOT_FOUND. For more information, see LSA Policy Function Return Values. Use the LsaNtStatusToWinError function to convert the NTSTATUS code to a Windows error code.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderNtsecapi.h
LibraryAdvapi32.lib
DLLAdvapi32.dll

See Also

LsaAddAccountRights
LsaFreeMemory
LsaRemoveAccountRights
LSA_UNICODE_STRING

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Page view tracker