We've user with 3 groups assigned:
All above resides in UNSAccountBInUNSGroupB.
I'm trying to delete above with script:
Public Function TSB_UNSAccountBInUNSGroupB_Delete(ByVal UID_UNSAccountB As String, ByVal UID_UNSGroupB As String) As Boolean
Dim UNSAccountBInUNSGroupB As IEntity = Nothing
Dim f As ISqlFormatter = Connection.SqlFormatter
If Session.Source.TryGet( Query.From("UNSAccountBInUNSGroupB") _
.Where(f.Comparison("UID_UNSAccountB", UID_UNSAccountB, ValType.String, CompareOperator.Equal, FormatterOptions.NonUnicodeLiterals)) _
.Where(f.Comparison("UID_UNSGroupB", UID_UNSGroupB, ValType.String, CompareOperator.Equal, FormatterOptions.NonUnicodeLiterals)) _
.SelectNonLobs, UNSAccountBInUNSGroupB )
Dim deepDelete = UNSAccountBInUNSGroupB.DeepDelete(Session)
but I'm able to delete only GC assignement? How to delete two others?
In reply to Geraldine Hopf:
In reply to p.noga:
In reply to Markus Weiss-Ehlers:
Speaking generally, you cannot delete the inherited group membership you can only deal with the cause that lead to the membership. That's the whole point of having automated inherited memberships.
But there OOTB functions that do kind of removal for example when you have denied membership attestations. The configuration parameter for your case would be QER\Attestation\AutoRemovalScope\GroupMembership and the scripts (for your case) is called VI_AttestationCase_RemoveGroupMembership triggered by the process VI_Attestation_AttestationCase_AutoRemoveMemberships .
You can use this as guidance how to deal with your problem.
But please keep my advise in mind in regards to the inherited memberships and the potential collateral damage.