Google Reviews
If you find this content or our services useful, please leave us a review.

I was working on an application migration recently, and wanted to see how many users/computers were in each application Active Directory (AD) group in a specified Organisational Unit (OU).  I wrote a PowerShell script to find the membership count of all AD Groups in an OU:

$Groups = Get-ADGroup -Properties * -Filter * -SearchBase "OU=Applications,DC=alkane,DC=co,DC=uk" 
Foreach($group In $groups)
    $groupname = $group.Name 
    $groupdescription = $group.Description
    $groupdn = $group.DistinguishedName
    $groupcount = $group.member.count


Find the Membership Count of all AD Groups in an OU
Comments have now been disabled. If you have a question to ask about this post please ask the community!