The script returns true if the number of direct group members equals or exceeds a specific limit. The script can be used in the If PowerShell script returns true condition in business rules, custom commands and scheduled tasks configured for the Group object type.
Parameter:
- $membersLimit - Specifies the direct group members limit.
PowerShell
$membersLimit = 24 # TODO: modify me
$members = $Context.TargetObject.GetEx("member")
$Context.ConditionIsMet = $members.Length -ge $membersLimit