MOTOBIT.COM - ASP upload, IIS utility Items Property, read only of GroupMembers class

Property, read only | Member of  UserManager.GroupMembers | Changes | Purchase | Download


Returns all group members in the collection as an safearray.


vItems = GroupMembers.Items




Enumerate localgroup members

Wscript.Echo "Server local groups and members :"

Dim Server, User, A, I
Set Server = CreateObject("UserManager.Server")
For Each Group In Server.LocalGroups
  Wscript.Echo "LocalGroup : " & Group.Name
  EnumGroupMembers Group

Sub EnumGroupMembers(Group)
  'Put all users to an array
  Dim A
  A = Group.Members.Items

  'Go through the array
  'You can also use "For Each Member in Group.Members"
  For i=0 To UBound(A)
    If VarType(A(I)) = vbObject Then
      Wscript.Echo " - Member:" & A(I).Name
    Else'Some error
      Wscript.Echo " - Member:" & A(I)
    End If
End Sub

See also

Users.Items, Groups.Items, Servers.Items

Other links for Items

Methods of GroupMembers class

Add, SelectGroup

Properties of GroupMembers class

Count, Group, Item, Items, Server


Contains methods for enumerating and selecting user accounts from the group.
GroupMembers uses NetLocalGroupGetMembers or NetGroupGetUsers to enumerate group members.


ActiveX UserManager is easy to use COM component with classes to create, delete and manage local and remote user accounts, groups, servers and domains in the Windows NT (2000/XP) environment. You can simple work with user accounts and groups from VBA, VBS/JS, ASP and T-SQL programming environment.

© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: