Groups.AddEx

This function adds a new Group into the collection, and return a new Group object (with audit log explanation).

Syntax Parameters Return Value
Function Groups.AddEx( _
    CreateInfo As GroupCreateInfo) As Group
CreateInfo [in]

Information about the group being created.

Type: GroupCreateInfo

Group

SVB Example

Adding a group:

Sub Main

    Dim oOM As ObjectManager
    'Reconnect into Enterprise
    Set oOM = New ObjectManager
    oOM.Reconnect Application

    'Create a new group
    Dim groupInfo As New GroupCreateInfo
    groupInfo.AuditLogReason = "Adding Basic Stats group"
    groupInfo.Name = "Basic Stats Users"

    'Add the new group
    Dim BasicStatsGroup As Group
    Set BasicStatsGroup = oOM.Groups.AddEx(groupInfo)

    'Add a description
    BasicStatsGroup.AutoSave = False
    BasicStatsGroup.Description = "Group for running only Basic Statistics"
    'Add Blake to this new group
    BasicStatsGroup.Members.Add(oOM.Users.Item("Blake"))

    'Set the group permissions, which will only be users and web users
    BasicStatsGroup.Permissions.Add(sta_PERM_USR)
    BasicStatsGroup.Permissions.Add(sta_PERM_WEBUSER)

    'Set the analysis permissions, which will only include Basis Statistics
    BasicStatsGroup.AnalysisModules.Add("BASX")

    'Save our changes
    Dim updateInfo As New GroupUpdateInfo
    updateInfo.AuditLogReason = "Setting up the Basic Stats user group."
    BasicStatsGroup.SaveEx(updateInfo)

    oOM.Disconnect

End Sub