Skip to main content

List group user memberships

Log in to add to favourites

Listing the users that are members of groups can be achieved by using one of the Users method overloads.

List users that are members of the group.

Syntax

C#
public PagedList<User> List(SecurityListOptions listOptions = null)
{    
}

Parameters

listOptions

Type: SecurityListOptions
The list options, page size, page index, etc.

Examples

C#
using Zengenti.Contensis.Management;
using Zengenti.Data;

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

SecurityListOptions listOptions = new SecurityListOptions 
{
    PageOptions = new PageOptions(0, 10)
};

// Get the group
Group group = client.Security.Groups.Get("System Administrators");

// List the users
PagedList<User> members = group.Users(listOptions);

List users that are members of the group asynchronously.

Syntax

C#
public Task<PagedList<User>> List(SecurityListOptions listOptions = null)
{    
}

Parameters

listOptions

Type: SecurityListOptions
The list options, page size, page index, etc.

Examples

C#
using Zengenti.Contensis.Management;
using Zengenti.Data;

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

SecurityListOptions listOptions = new SecurityListOptions 
{
    PageOptions = new PageOptions(0, 10)
};

// Get the group
Group group = await client.Security.Groups.Get("System Administrators");

// List the users
PagedList<User> members = await group.UsersAsync(listOptions);

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