Export (0) Print
Expand All
Expand Minimize

AuditSetPerUserPolicy function

The AuditSetPerUserPolicy function sets per-user audit policy in one or more audit subcategories for the specified principal.

Syntax


BOOLEAN WINAPI AuditSetPerUserPolicy(
  _In_  const PSID pSid,
  _In_  PCAUDIT_POLICY_INFORMATION pAuditPolicy,
  _In_  ULONG PolicyCount
);

Parameters

pSid [in]

A pointer to the SID structure associated with the principal for which to set audit policy. Per-user policy for group SIDs is not currently supported.

pAuditPolicy [in]

A pointer to an array of AUDIT_POLICY_INFORMATION structures. Each structure specifies per-user audit policy for one audit subcategory.

The AuditCategoryGuid member of these structures is ignored.

PolicyCount [in]

The number of elements in the pAuditPolicy array.

Return value

If the function succeeds, it returns TRUE.

If the function fails, it returns FALSE. To get extended error information, call GetLastError. GetLastError may return one of the following error codes defined in WinError.h.

Return code/valueDescription
ERROR_ACCESS_DENIED
5

The caller does not have the privilege or access rights necessary to call this function.

ERROR_INVALID_PARAMETER
87

One or more parameters are invalid.

ERROR_NO_SUCH_USER
1317

The SID structure specified by the pSID parameter is not associated with an existing user.

 

Remarks

To successfully call this function, the caller must have SeSecurityPrivilege or have AUDIT_SET_USER_POLICY access on the Audit security object.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Ntsecapi.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

AuditQueryPerUserPolicy
AuditQuerySystemPolicy
AuditSetSystemPolicy

 

 

Community Additions

ADD
Show:
© 2014 Microsoft