Create and update groups
Log in to add to favouritesCreating 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
public Group New(string groupName, GroupType groupType)
{
}
Parameters
groupName
Type: string
The group name.
groupType
Type: GroupType
The type of group.
Examples
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
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();