Skip to content

UsrMgr_EnumMembersOfLocalGroup

Enumerates the members of a local group. This function only returns direct members. Members of nested groups aren’t included.

If the group doesn’t exist, the function returns True and gaValue is an empty array.

UsrMgr_EnumMembersOfLocalGroup(sGroupName) As Boolean

Name or SID of the local group. The name isn’t case sensitive.

Result will be stored in gaValue as an array of member names. Domain members are returned as DOMAIN\Name. Well-known accounts, such as INTERACTIVE, are returned by name only.

If bStatus Then bStatus = UsrMgr_EnumMembersOfLocalGroup("CapaInstaller")
If bStatus And IsArray(gaValue) Then
For index = LBound(gaValue) to UBound(gaValue)
bStatus = Job_WriteLog("Custom", "Index #" & index & ": " & cStr(gaValue(index)), bStatus, True)
Next
End If

Scripting Guidelines

UsrMgr_CreateLocalUser UsrMgr_CreateLocalGroup UsrMgr_IsUserMemberOfLocalGroup Constants Package Property Variables