DirectoryServiceData / Client / list_users

list_users#

DirectoryServiceData.Client.list_users(**kwargs)#

Returns user information for the specified directory.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items.

You can also specify a maximum number of return results with the MaxResults parameter.

See also: AWS API Documentation

Request Syntax

response = client.list_users(
    DirectoryId='string',
    MaxResults=123,
    NextToken='string',
    Realm='string'
)
Parameters:
  • DirectoryId (string) –

    [REQUIRED]

    The identifier (ID) of the directory that’s associated with the user.

  • MaxResults (integer) – The maximum number of results to be returned per request.

  • NextToken (string) – An encoded paging token for paginated calls that can be passed back to retrieve the next page.

  • Realm (string) –

    The domain name that’s associated with the user.

    Note

    This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

    This value is case insensitive.

Return type:

dict

Returns:

Response Syntax

{
    'DirectoryId': 'string',
    'NextToken': 'string',
    'Realm': 'string',
    'Users': [
        {
            'Enabled': True|False,
            'GivenName': 'string',
            'SAMAccountName': 'string',
            'SID': 'string',
            'Surname': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • DirectoryId (string) –

      The identifier (ID) of the directory that’s associated with the user.

    • NextToken (string) –

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

    • Realm (string) –

      The domain that’s associated with the user.

    • Users (list) –

      The user information that the request returns.

      • (dict) –

        A structure containing a subset of the fields of a user object from a directory.

        • Enabled (boolean) –

          Indicates whether the user account is active.

        • GivenName (string) –

          The first name of the user.

        • SAMAccountName (string) –

          The name of the user.

        • SID (string) –

          The unique security identifier (SID) of the user.

        • Surname (string) –

          The last name of the user.

Exceptions