active directory

I need to get a count of objects in active directory. Total objects, then a count of just user identities (all authentication accounts).
pramod1Asked:
Who is Participating?
 
Joseph MoodyBlogger and wearer of all hats.Commented:
(Get-ADObject -Filter *).count | out-file .\count.txt
0
 
Joseph MoodyBlogger and wearer of all hats.Commented:
You can use the powershell command: (Get-ADObject -Filter *).count to get a count of all ad objects. Change Get-ADObject to Get-ADUser to get a count of all AD users.
0
 
Austin TexasSystems EngineerCommented:
You can pipe the results of "dsquery user" to a text file and then drop that in excel to get a count of user objects in your AD.

An alternative tool would be joeware's ADFIND. This example will display the number of user accounts in the "domain.com" domain.
adfind -b "dc=domain,dc=com" -f "objectcategory=person" -c

Open in new window

0
 
pramod1Author Commented:
how can I out put Get-ADObject -Filter *) to  a txt file , I need to have count
0
 
SubsunCommented:
To get object count
(Get-ADObject -Filter * | Measure).Count

Open in new window

To get user count
(Get-ADUser -Filter * | Measure).Count

Open in new window

To get count for each ObjectClass
Get-ADObject -Filter * | Group ObjectClass | Select Name,Count

Open in new window

Not sure, what you mean by  'all authentication accounts'.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.