Title: Message

Check out http://www.windowsitpro.com/Windows/Article/ArticleID/44085/44085.html for a script that will document the OU structure and the number of user, group and computer accounts contained therein.  It doesn’t list the individual accounts that are contained in each, but it should be easy enough (says she who has no grasp of coding) to tweak it to output each of these rather than just updating the count.

 

Cheers,

katherine


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lou Vega
Sent: Wednesday, 2 February 2005 7:38 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] ADUC Export

 

If you’re interested I have similar code which can be dropped into a simple VB.NET form and run that way. I was doing this type of operation routinely enough that I just put the whole thing in a VB.NET app so I could pull it up on the screen for the management whenever they wanted it.

 

r/

Lou

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brad Hibbert
Sent: Tuesday, February 01, 2005 3:20 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] ADUC Export

 

Here is a simple recursive VB script that can accomplish this

 

strDomain = "DC=ds,dc=nplab,dc=secure"  ‘ Enter your DN here
strOutput = ""
enumerateOUs(strDomain)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("Result.txt", true)
file.writeLine(strOutput)
file.Close
Function enumerateOUs(strDN)
            Set container = GetObject("LDAP://" + strDN)
            
            strOutput = strOutput & "Current OU" & vbTab & strDN & vbcrlf
            container.Filter = Array("User")
            For each obj in container
                        If obj.class="user" Then
                                    strOutput = strOutput & vbTab & vbTab & vbTab & obj.DistinguishedName & vbcrlf
                        End If
            next
            container.Filter = Array("OrganizationalUnit")
            For each Obj in Container
                        enumerateOUs(obj.distinguishedName)
            Next
End Function

 

Regards

Brad

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rogers, James
Sent: Tuesday, February 01, 2005 7:08 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] ADUC Export

In ADUC 2003, an "Export List" command is available that will export the contents of the immediate OU you're viewing.  Is there a way to export the full tree for an entire domain?  I'd like to pull a list of all OU's, their position in the tree, and their contents.  Is this possible, or just a pipe dream?

 

-James R. Rogers

Reply via email to