EnumUsersInRole3

Returns the security identifiers and usernames of the users and groups assigned to a given role, and optionally allows you to return this information for users of any groups assigned to the role.

Syntax

<HsvSecurityAccess>.EnumUsersInRole3 lRoleID, vbExpandGroup, pvarabstrUserSIDs, pvarabstrNames

Argument

Description

lRoleID

Long (ByVal). The ID of the role. For a list of valid role IDs, see Role ID Constants.

Tip:

To get a role’s ID from its name, use GetRoleID.

vbExpandGroup

Boolean (ByVal). A flag that specifies whether to include security identifiers and usernames of groups’ users. Pass TRUE to return details of groups’ users, FALSE otherwise.

pvarabstrUserSIDs

Variant. Returns an array containing the security identifiers of the users and groups assigned to the role.

This array has a one-to-one correspondence with the array returned by the pvarabstrNames argument.

pvarabstrNames

Variant. Returns an array containing the usernames of the users and groups assigned to the role.