Script Repository


Check if the number of direct group members exceeds limit

February 25, 2021
126

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.
Edit Remove
PowerShell
$membersLimit = 24 # TODO: modify me

$members = $Context.TargetObject.GetEx("member")
$Context.ConditionIsMet = $members.Length -ge $membersLimit

Comments ( 0 )
No results found.
Leave a comment