Richard
Fri Jan 26 13:06:15 CST 2007
You can hard code the Distinguished Name of the OU you want to use as the
base of the search. Instead of:
"<LDAP://" & strDNSDomain & ">"
replace strDNSDomain with the Distinguished Name. For example:
"<LDAP://ou=Sales,ou=West,dc=MyDomain,dc=com>"
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site -
http://www.rlmueller.net
--
"cmatera" <cmatera@gmail.com> wrote in message
news:1169837330.811678.245340@j27g2000cwj.googlegroups.com...
> Ok, I see that both scripts do something similar:
>
> ' Determine the DNS domain from the RootDSE object.
> Set objRootDSE = GetObject("LDAP://RootDSE")
> strDNSDomain = objRootDSE.Get("defaultNamingContext")
>
> How would I modify this so that it doesn't go to the root - but rather
> goes right into my OU?
>
> Thanks for all the help - it is very much appreciated
>
> -Chris
>
>
> On Jan 26, 12:19 pm, "Richard Mueller [MVP]"
> <rlmueller-NOS...@ameritech.NOSPAM.net> wrote:
> > Chris wrote:
> > > Just some background: My organization is an OU within a larger OU.
> > > Within my organizational unit I have OU's for Users, Computers and
> > > Servers. Within my Users OU, I want to dump the membership of all
> > > groups into a text file. Which I can then import into excel. Anyone
> > > have any pointers or example scripts I can look at?I have some same
VBScript programs that should help. First example documents
> > all groups in Active Directory:
> >
> >
http://www.rlmueller.net/Document%20Domain%20Groups.htm
> >
> > Second example documents membership in one group:
> >
> >
http://www.rlmueller.net/List%20Members%20of%20a%20Group.htm
> >
> > The first example shows direct membership only, but membership due to
group
> > nesting can be determined from the output. The second example reveals
> > membership due to group nesting.
> >
> > --
> > Richard
> > Microsoft MVP Scripting and ADSI
> > Hilltop Lab web site -
http://www.rlmueller.net
> > --
>