Enumerate members of Administrators Group (AD)
- From: "BH Jodo Kast" <benjaminlindelof@xxxxxxxxx>
- Date: 2 Mar 2006 12:09:32 -0800
Hi,
I found this handy script and I'm trying to convert it to VB.NET. It
pops up a list of members in the Administrators/Builtin group. Can't
seem to get DirectorySearcher or DirectoryEntry working similar to
this. Run this as a VBS script to see:
Option Explicit
Dim strUser, strMember, strDNSDomain, strContainer
Dim objGroup, objUser, objRootDSE
Dim arrMemberOf
' Bind to Active Directory'
strContainer = "cn=Administrators,cn=Builtin, "
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
' Get the Builtin Administrators group
Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
objGroup.getInfo
arrMemberOf = objGroup.GetEx("member")
' Loop = For Each .... Next
WScript.Echo "Members of Group " & strContainer
For Each strMember in arrMemberOf
WScript.echo strMember
Next
Wscript.Quit
Thanks for your help!
.
- Follow-Ups:
- Re: Enumerate members of Administrators Group (AD)
- From: vbnetdev
- Re: Enumerate members of Administrators Group (AD)
- Prev by Date: Re: Namespace Question ...
- Next by Date: Re: Problem: Unwanted Paper feed after printing.
- Previous by thread: Re: Change Report Connection at Runtime
- Next by thread: Re: Enumerate members of Administrators Group (AD)
- Index(es):