EnumUsersInRole2

Returns the security identifiers and usernames of the users and groups assigned to a given role.

Tip:

To return security identifiers and usernames of users who belong to groups assigned to a role, use EnumUsersInRole3.

Syntax

<HsvSecurityAccess>.EnumUsersInRole2 lRoleID, 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.

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.