DirectoryServiceData / Client / create_user

create_user#

DirectoryServiceData.Client.create_user(**kwargs)#

Creates a new user.

See also: AWS API Documentation

Request Syntax

response = client.create_user(
    ClientToken='string',
    DirectoryId='string',
    EmailAddress='string',
    GivenName='string',
    OtherAttributes={
        'string': {
            'BOOL': True|False,
            'N': 123,
            'S': 'string',
            'SS': [
                'string',
            ]
        }
    },
    SAMAccountName='string',
    Surname='string'
)
Parameters:
  • ClientToken (string) –

    A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

    A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

    If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

    Note

    This parameter is optional when using the CLI or SDK.

    This field is autopopulated if not provided.

  • DirectoryId (string) –

    [REQUIRED]

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

  • EmailAddress (string) – The email address of the user.

  • GivenName (string) – The first name of the user.

  • OtherAttributes (dict) –

    An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

    Note

    Attribute names are case insensitive.

    • (string) –

      • (dict) –

        The data type for an attribute. Each attribute value is described as a name-value pair. The name is the AD schema name, and the value is the data itself. For a list of supported attributes, see Directory Service Data Attributes.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: BOOL, N, S, SS.

        • BOOL (boolean) –

          Indicates that the attribute type value is a boolean. For example:

          "BOOL": true

        • N (integer) –

          Indicates that the attribute type value is a number. For example:

          "N": "16"

        • S (string) –

          Indicates that the attribute type value is a string. For example:

          "S": "S Group"

        • SS (list) –

          Indicates that the attribute type value is a string set. For example:

          "SS": ["sample_service_class/host.sample.com:1234/sample_service_name_1", "sample_service_class/host.sample.com:1234/sample_service_name_2"]

          • (string) –

  • SAMAccountName (string) –

    [REQUIRED]

    The name of the user.

  • Surname (string) – The last name of the user.

Return type:

dict

Returns:

Response Syntax

{
    'DirectoryId': 'string',
    'SAMAccountName': 'string',
    'SID': 'string'
}

Response Structure

  • (dict) –

    • DirectoryId (string) –

      The identifier (ID) of the directory where the address block is added.

    • SAMAccountName (string) –

      The name of the user.

    • SID (string) –

      The unique security identifier (SID) of the user.

Exceptions