Users Count

  • Thread starter Thread starter Mauricio de Leon
  • Start date Start date
M

Mauricio de Leon

Please, anyone can tell me how to make a count of the
users in my domain or users members for OU?
 
use this simple script


Set OU=Getobject(LDAP://Ou=xxxxxx,dc=y,dc=z)
OU.Filter=Array("user")
For Each Usr in OU
i=i+1
Next

Wscript.Echo i




Enter the OU and domain details.Save above to a file with a .vbs extension
and then run using
cscript <name>.vbs
 
Grab adfind from www.joeware.net on the free win32 tools page


adfind -b <DN of OU> -f "&(objectcategory=person)(samaccountname=*)(objectclass=user)" -c

If you want it for the whole default domain you can simply do

adfind -default -f "&(objectcategory=person)(samaccountname=*)(objectclass=user)" -c

You can also do an enumeration like nico showed but it would be considerably slower.



[Thu 09/18/2003 19:18:01.14]
F:\Dev\cpp\Quiet>
[Thu 09/18/2003 19:18:01.36]
F:\Dev\cpp\Quiet>adfind -default -f "&(objectcategory=person)(samaccountname=*)(objectclass=user)" -c

AdFind V01.12.00cpp Joe Richards ([email protected]) May 2003

Using server: w2kasdc1.joehome.com
Base DN: DC=joehome,DC=com


2032 Objects returned

[Thu 09/18/2003 19:18:04.82]
F:\Dev\cpp\Quiet>
 
Back
Top