To count the number of users in an Active Directory group:
(Get-ADGroup My_Group_Name -Properties *).Member.Count