Sometimes it is important to know how many users are in a particular Active Directory Security Group. The below PowerShell code will accomplish this for you.

The Get-ADGroupMember cmdlet gets the members of an Active Directory group. Members can be users, groups, and computers.

Code:

$users = Get-ADGroupMember -Identity 'Group Name' 

$users.Count

PowerShell: Counting users in Active Directory Group

If you need assistance with Microsoft PowerShell or Active Directory,  please give us a call today!

Leave a Reply