Skip to main content

Add child groups to a group

Log in to add to favourites

Add child group

C#
1
2
3
public void AddChildGroup(Guid parentGroupId, Guid childGroupId) { }
C#
1
2
3
4
5
6
7
8
9
10
11
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Mimic a parent and child group id Guid parentGroupId = Guid.Parse("4af76fbe-edfd-4333-8fea-817174343c27"); Guid childGroupId = Guid.Parse("71efc7a2-c716-4337-a94c-73fb69349248"); // Add the child group client.Security.Groups.AddChildGroup(parentGroupId, childGroupId);

Add child group async

C#
1
2
3
public async Task AddChildGroupAsync(Guid parentGroupId, Guid childGroupId) { }
C#
1
2
3
4
5
6
7
8
9
10
11
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Mimic a parent and child group id Guid parentGroupId = Guid.Parse("4af76fbe-edfd-4333-8fea-817174343c27"); Guid childGroupId = Guid.Parse("71efc7a2-c716-4337-a94c-73fb69349248"); // Add the child group await client.Security.Groups.AddChildGroupAsync(parentGroupId, childGroupId);

Add child group from a group

C#
1
2
3
public void AddChildGroup(Group childGroup) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Get the Everyone group Group everyoneGroup = client.Security.Groups.Get("Everyone"); // Get a group to add Group fightClubAdministrators = client.Security.Groups.Get("Fight Club Administrators"); // Add the fight club administrators group to the Everyone group everyoneGroup.AddGroup(fightClubAdministrators);

Add child group from a group async

C#
1
2
3
public async Task AddChildGroupAsync(Group childGroup) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Get the Everyone group Group everyoneGroup = await client.Security.Groups.GetAsync("Everyone"); // Get a group to add Group fightClubAdministrators = await client.Security.Groups.GetAsync("Fight Club Administrators"); // Add the fight club administrators group to the Everyone group await everyoneGroup.AddGroupAsync(fightClubAdministrators);

Still need help?

New support request