Forum Discussion
Satish
New Contributor II
Thank you so much for taking time RobbSalzmann for posting the above info, really appreciate.
i already got this info and were able to perform the activity.
Krishna
8 months agoValued Contributor
Satish - You can use the below code to delete the group
'Read the File
Dim FileReader As New System.IO.StreamReader(folderPath)
'Store the data
Dim stringReader As String = String.Empty
stringReader = FileReader.ReadLine()
'Read Each Line
For Each line As String In File.ReadLines(folderPath)
'Assign the Security GroupName from File to the String
Dim NewSecurityGroupName As String = line
Dim objGroupInfo1 As GroupInfo = BRApi.Security.Admin.GetGroup(si, NewSecurityGroupName)
If Not objGroupInfo1 Is Nothing Then
'Create a Object for Class Group
Dim objGroup As Group = New Group()
objGroup.Name = NewSecurityGroupName
'Create a Object for Class GroupInfo
Dim objGroupInfo As GroupInfo = New GroupInfo()
objGroupInfo.Group = objGroup
'Check the Group Already Exists
'BRApi.Security.Admin.SaveGroup(si, objGroupInfo, False, Nothing, TriStateBool.TrueValue)
BRApi.Security.Admin.DeleteGroup(si,NewSecurityGroupName)
BRApi.ErrorLog.LogMessage(si,NewSecurityGroupName & " " & "Group Deleted")
End If
Next
FileReader.Close()
Related Content
- 4 months ago
- 10 months ago