Skip to main content

Create and update groups

Log in to add to favourites

Creating and updating groups can be achieved by using one of the New method overloads in combination with calling Save on the Group class.

Initializes a new group with a group name and type. The group is not created from calling New.

Syntax

C#
public Group New(string groupName, GroupType groupType)
{    
}

Parameters

groupName

Type: string
The group name.

groupType

Type: GroupType
The type of group.

Examples

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Initialize the group
Group group = client.Security.Groups.New("Fight Club Members", GroupType.Contensis);

// Create the group
group.Save();

// Create the group asynchronously
await group.SaveAsync();

Updates an existing group.

Examples

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get an existing group
Group group = client.Security.Groups.Get("Fight Club Members");

// Update group details
group.Description = "Members of Fight Club";

// Update the group
group.Save();

// Update the group asynchronously
await group.SaveAsync();

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request