Skip to main content
Expert
October 22, 2022

Bulk Delete Security Group

  • October 22, 2022
  • 2 replies
  • 0 views

The below code will delete the Security Group using extender rule.

 

 

 

 

Dim secGrp As List(Of Group) = Brapi.Security.Admin.GetGroups(si)
       For Each Item As Group In secGrp

           If Item.Name <> "Nobody" Or Item.Name <> "Administrators" Or Item.Name <> 
             "Everyone"
              Brapi.Security.Admin.DeleteGroup(si,Item.Name)

        End If
      Next

 

 

 

 

2 replies

OneStream Employee
October 31, 2022

Thanks! Word of warning though: make sure the groups you delete are really not referenced, or it might create problems down the line.

KrishnaAuthor
Expert
October 31, 2022

Agreed and please make sure run this in Dev Environment before running into PROD.