Count how many users are in an AD group
The following article explains how to count how many users are members of a particular Active Directory group. This can be useful when synchronising specific users for MFA to ensure you have adequate licenses available.
- Log in to one of your Active Directory domain controllers
- Open the Powershell terminal as an administrator
- Use the following command:
(Get-ADGroup <group> -Properties *).Member.Count
where<group>
is the name of an Active Directory security group.
Examples for a group called "MFA_Users" and a group containing a space, e.g. "Enforce MFA" (note the use of double quotes)
(Get-ADGroup MFA_Users -Properties *).Member.Count
(Get-ADGroup "Enforce MFA" -Properties *).Member.Count
- Ensure that you have sufficient MFA licenses to cover the number returned in the command output