Solved

active directory

Posted on 2016-10-24
5
64 Views
Last Modified: 2016-10-24
I need to get a count of objects in active directory. Total objects, then a count of just user identities (all authentication accounts).
0
Comment
Question by:pramod1
5 Comments
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 41857065
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
 
LVL 5

Expert Comment

by:Austin Texas
ID: 41857066
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
 

Author Comment

by:pramod1
ID: 41857075
how can I out put Get-ADObject -Filter *) to  a txt file , I need to have count
0
 
LVL 22

Accepted Solution

by:
Joseph Moody earned 250 total points
ID: 41857081
(Get-ADObject -Filter *).count | out-file .\count.txt
0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 250 total points
ID: 41857084
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

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question