Sm_PolicyApi_AddUsersToPolicy()

Adds a user directory entry to the policy identified by pszPolicyOid. Only one user specification (which may be an aggregate) can be added at a time.
sm1252sp1
Adds a user directory entry to the policy identified by
pszPolicyOid
. Only one user specification (which may be an aggregate) can be added at a time.
Type
User and user state function.
Syntax
int SM_EXTERN Sm_PolicyApi_AddUsersToPolicy (
void*pSessionHandle,const char*pszPolicyOid,Sm_PolicyApi_User_t*pStructUsers,intiPolicyFlags
);
Parameter
I/O
Description
pSessionHandle
I
A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session.
pszPolicyOid
I
A null-terminated string containing the object identifier of an existing policy to which a user is to be added.
pStructUsers
I
Pointer to a Sm_PolicyApi_User_t structure containing information about the user directory.
iPolicyFlags
I
A bit field that indicates whether the policy includes or excludes users, and whether the policy should be applied recursively. Bit definitions are listed in Policy Flags.
Returns
  • Sm_PolicyApi_Success. The add was successful.
  • Sm_PolicyApi_Failure. The user directory is not part of the domain user directory collection.
  • Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
  • Sm_PolicyApi_NoSession. There is no valid administrator session.
  • Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to add users to the policy.
  • Sm_PolicyApi_InvalidOid:
    • The policy OID was not found.
    • The user directory OID was not found.
  • Sm_PolicyApi_DuplicateEntry. The user is already part of the policy.
  • Sm_PolicyApi_InConsistentANDBitMask. An existing user policy of this particular user directory under the policy has a different value of Sm_PolicyBehavior_AND_Mask set as against the one to be added.