Solved

How to count users in specific OU in AD

Posted on 2014-04-18
3
19,083 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses

630 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