I just whipped up this _vbscript_ to get you started.  I don't have time to provide a more detailed breakdown as that involves a little extra thought, but this should point you in the right direction...
 
Save, for example, as c:\count.vbs and run, from CMD, like so:
    cscript c:\count.vbs > count.xls
 
Dim oRootDse, oBase
 
Set oRootDse = GetObject("LDAP://RootDSE")
Set oBase = GetObject("LDAP://" & oRootDse.get("defaultNamingContext"))
countObjects oBase.ADsPath, 0
 
 
 
' ***********************************************
' countObjects(ADsPath, count)
'
' Recursive function to count the number of children
' in a container.
'
' ***********************************************
Private Function countObjects(oParent, iCount)
 Dim oChild, cChildren, aSchema, sSchema
 Dim i : i = 0
 
 Set cChildren = GetObject(oParent)
 
 For Each oChild In cChildren
  aSchema = Split(oChild.schema,"/")
  sSchema = aSchema(UBound(aSchema,1))
 
  i = i + 1
  c = countObjects(oChild.ADsPath, i)
 
  If(Not(sSchema = "inetOrgPerson" Or _
      sSchema = "user" Or _
       sSchema = "computer" Or _
        sSchema = "group"))Then
  
   WScript.Echo oChild.get("distinguishedName") & vbTab &c
  End If
 Next
 
 countObjects=i
End Function

 
--Paul
----- Original Message -----
Sent: Thursday, August 10, 2006 12:49 AM
Subject: RE: [ActiveDir] machine GP load

Does anyone have, or know of, a utility program that will provide a breakout of object counts in AD in each container, with a rollup so that each container shows all of the containers below it ?
Joe ?
Thanks,
Jerry
 
Jerry Welch
CPS Systems
US/Canada: 888-666-0277
International: +1 703 827 0919 (-5 GMT)
IP Phone (Skype):  Jerry_Welch  ( www.skype.net )
 

Reply via email to