AddOrRemoveApplicationAdministrators2

Adds or removes one or more users from the Application Administrator role.

Syntax

<HsvSecurityAccess>.AddOrRemoveApplicationAdministrators2 varabstrUserSIDs, varabAdd

Argument

Description

varabstrUserSIDs

String array (ByVal). The security identifiers of the users being added to or removed from the Application Administrator role.

This array has a one-to-one correspondence with the varabAdd argument’s array. For example, the third element of the varabAdd array indicates whether the user identified by the third element of this array is added or removed.

varabAdd

Boolean array (ByVal). Indicates whether users should be added or removed from the Application Administrator role. Set an array element to TRUE to add a user, or to FALSE to remove a user.

Example

The following subroutine adds the specified users to the Application Administrator role. The subroutine takes an array of security identifiers.

Sub addAdmins(saSIDs() As String)
Dim cSecurity As HsvSecurityAccess, bAdd() As Boolean
'g_cSession is an HsvSession object reference
Set cSecurity = g_cSession.Security
ReDim bAdd(UBound(saSIDs))
For i = LBound(saSIDs) To UBound(saSIDs)
  bAdd(i) = True
Next i
cSecurity.AddOrRemoveApplicationAdministrators2 saSIDs, bAdd
End Sub