Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Enumerate Group Members
 

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.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
          - Ad User Information Query
          - Add Machine To Domain
          - Add User To Group
          - Create Group
          - Create Ou Structure
          - Enumerate Ad Users
          - Enumerate Group Members
          - Move Users And Groups Between Ous
          - Raise Domain Functional Level
     - Exchange
     - Files And Folders
     - General
     - Ms Office
     - Operating System
     - Processes And Services
     - Text Processing
     - User Interaction
     - Web Servers