Script Repository


Disallow adding groups to other groups

June 22, 2020
1373

The script can be used to disallow adding groups to other groups. When executed in a Business Rule triggered Before adding a member to a group, it will cancel the operation if the new member is a group.

Edit Remove
PowerShell
$member = $Context.BindToObjectByDN("%member%")

if ($member.Class -ieq "group")
{
    $Context.Cancel("You cannot add groups to other groups!") # TODO: modify me
}

Comments ( 0 )
No results found.
Leave a comment

Related Scripts