Solved

How to count users in specific OU in AD

Posted on 2014-04-18
3
13,409 Views
Last Modified: 2014-04-18
Hello all,
I would like to count the total of users in specific OU in AD. I found some command online or script but it did not work.

Get-ADUser -Filter * -SearchBase "ou=Accounting,ou=administration,ou=people,dc=ncmecad,dc=net"

Please give me some hints.
Thanks,
0
Comment
Question by:dongocdung
3 Comments
 
LVL 25

Accepted Solution

by:
Zephyr ICT earned 300 total points
ID: 40008582
If you just want to count the number of users in a OU you can use this:

(Get-ADUser -Filter * -SearchBase "ou=Accounting,ou=administration,ou=people,dc=ncmecad,dc=net").count

Open in new window

2
 
LVL 6

Assisted Solution

by:Hassan Besher
Hassan Besher earned 200 total points
ID: 40008589
0
 

Author Comment

by:dongocdung
ID: 40008718
The command from spravtek is used to have total count of users in the specific OU.
The script from the article is used to have total count of users in each OU in organization
Thanks for your help.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now