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>