Solved

How to count users in specific OU in AD

Posted on 2014-04-18
3
14,363 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

910 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

18 Experts available now in Live!

Get 1:1 Help Now