Skip to Content

PowerShell Command for User Count, Computer Count, and Group Count in Active Directory

Problem: How to list the number of user count, group count, and computer count within respective Active Directory using PowerShell command. Execute the list of PowerShell command in this article to display the object numbers from Active Directory.

Getting Object Numbers From Active Directory

User Count

(Get-ADUser -Filter *).Count

Computer Count

(Get-ADComputer -Filter *).Count

Group Count

(Get-ADGroup -Filter *).Count

PowerShell Command for User Count, Computer Count, and Group Count in Active Directory

PowerShell Command for User Count, Computer Count, and Group Count in Active Directory

Enabled or Disabled User Count

Count on enabled or disabled users:
(Get-AdUser -filter ‘Enabled -eq $true’).count
(Get-AdUser -filter ‘Enabled -eq $false’).count

Group User Count

Count only users in a particular group:
(Get-ADGroup GS-VPN-Users -Properties *).Member.Count

OU User Count

Count only users in particular OU:
(Get-ADUser -Filter * -SearchBase “OU=Users, OU=PNL,DC=pnl,DC=com”).Count

PowerShell Command for Group User Count and OU User Count.

PowerShell Command for Group User Count and OU User Count.

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that\'s committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we haven\'t implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you\'re currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.