Vbscript / Active Directory / Enumerate Group Members
List all members in a group and diplay the type of object e.g. user or group.
strDomain = "mydomain" strGroup = "finance"
strMembers = "Members of: " & strGroup & vbCRLF
set objDomain = GetObject("WinNT://" & strDomain & "/" & strGroup)
for each objMember in objDomain.Members strMembers = strMembers & objMember.FullName & " (" & objMember.Class & ")" & vbCRLF Next
Wscript.Echo strMembers
Please note that a disclaimer applies to any code on this page.
|