|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 Next 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 Next End Sub
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: firstname.lastname@example.org