Lol you are right, did not see  that J learn the hard way

 

Thanks

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Williams
Sent: Thursday, August 10, 2006 10:40 AM
To: [email protected]
Subject: Re: [ActiveDir] machine GP load

 

Ha ha.  That's why my post says to run using CSCRIPT.

 

 

--Paul

----- Original Message -----

From: Ramon Linan

Sent: Thursday, August 10, 2006 2:31 PM

Subject: RE: [ActiveDir] machine GP load

 

I tried it out, I was hitting the enter key forever thanks to:

WScript.Echo oChild.get("distinguishedName") & vbTab &c

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Williams
Sent: Thursday, August 10, 2006 8:59 AM
To: [email protected]
Subject: Re: [ActiveDir] machine GP load

 

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 -----

From: Jerry Welch

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