Is there a way to remove set of users from groups via xml(Load/Extract oprtion)

Satish
New Contributor

Hi,

Is there any way to remove users from the groups by using Load/Extract option from the system tab. i know we can add new groups or users but i want to remove the existing user from existing groups via xml.

Thank you in Advance, much appreciated for the help.

Thanks

Satish P 

3 REPLIES 3

Krishna
Valued Contributor

@Satish  - It can be done using the extract and edit, save the XML file and load it into the OS.

Krishna_0-1715262816765.png

 

Thanks
Krishna

cbriscoe
New Contributor III

Hi Krishna. We can also delete users and groups using Extender rules. 

cbriscoe
New Contributor III

HI Satish P

You can delete users and groups using Extender rules. Try this rule below. Have fun :).

Imports System
Imports System.Data
Imports System.Data.Common
Imports System.IO
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database
 
Namespace OneStream.BusinessRule.Extender.DeleteSecurityGroups
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
Select Case args.FunctionType
 
Case Is = ExtenderFunctionType.Unknown
                Dim secGroupsToDelete As New List(Of String)({"GroupA","GroupB","GroupC"}) 
For Each secGroup As String In secGroupsToDelete
BRApi.Security.Admin.DeleteGroup(si,secGroup)
BRAPi.ErrorLog.LogMessage(si, "Security Group '" & secGroup & "' deleted by rule.")
Next
End Select
 
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
 
Remeber - You tell the code what you want to delete by putting it in a Lookup transformation rule.