I am trying to write a PS script for a business rule, that would cancel operation when user tries to remove the "last" RBAC group.
Say the group structure is like that:
|___Team A RBAC
A user can be assigned to as many RBAC group as necessary but to at least one. Since group owners can change the group membership we need a rule that will stop the action if a user is removed from the "last" group.
As all RBAC groups are members of "Main RBAC" I was thinking of checking simply the presence of "Main RBAC" - but I can't figure out how to do it properly.
Thanks for suggestiong