Solved

How to count users in specific OU in AD

Posted on 2014-04-18
3
16,262 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

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