:doc:`DirectoryServiceData <../../ds-data>` / Client / describe_user

*************
describe_user
*************



.. py:method:: DirectoryServiceData.Client.describe_user(**kwargs)

  

  Returns information about a specific user.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/directory-service-data-2023-05-31/DescribeUser>`_  


  **Request Syntax**
  ::

    response = client.describe_user(
        DirectoryId='string',
        OtherAttributes=[
            'string',
        ],
        Realm='string',
        SAMAccountName='string'
    )
    
  :type DirectoryId: string
  :param DirectoryId: **[REQUIRED]** 

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

    

  
  :type OtherAttributes: list
  :param OtherAttributes: 

    One or more attribute names to be returned for the user. 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 <https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ad_data_attributes.html>`__.

    

  
    - *(string) --* 

    

  :type Realm: string
  :param Realm: 

    The domain name that's associated with the user.

     

    .. note::

      

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

       

      This value is case insensitive.

      

    

  
  :type SAMAccountName: string
  :param SAMAccountName: **[REQUIRED]** 

    The name of the user.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'DirectoryId': 'string',
          'DistinguishedName': 'string',
          'EmailAddress': 'string',
          'Enabled': True|False,
          'GivenName': 'string',
          'OtherAttributes': {
              'string': {
                  'BOOL': True|False,
                  'N': 123,
                  'S': 'string',
                  'SS': [
                      'string',
                  ]
              }
          },
          'Realm': 'string',
          'SAMAccountName': 'string',
          'SID': 'string',
          'Surname': 'string',
          'UserPrincipalName': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DirectoryId** *(string) --* 

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

        
      

      - **DistinguishedName** *(string) --* 

        The `distinguished name <https://learn.microsoft.com/en-us/windows/win32/ad/object-names-and-identities#distinguished-name>`__ of the object.

        
      

      - **EmailAddress** *(string) --* 

        The email address of the user.

        
      

      - **Enabled** *(boolean) --* 

        Indicates whether the user account is active.

        
      

      - **GivenName** *(string) --* 

        The first name of the user.

        
      

      - **OtherAttributes** *(dict) --* 

        The attribute values that are returned for the attribute names that are included in the request.

         

        .. 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 <https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ad_data_attributes.html>`__.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``BOOL``, ``N``, ``S``, ``SS``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **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) --* 
          
        
    
  
      

      - **Realm** *(string) --* 

        The domain name that's associated with 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.

        
      

      - **UserPrincipalName** *(string) --* 

        The UPN that is an Internet-style login name for a user and is based on the Internet standard `RFC 822 <https://datatracker.ietf.org/doc/html/rfc822>`__. The UPN is shorter than the distinguished name and easier to remember.

        
  
  **Exceptions**
  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.InternalServerException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ValidationException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.DirectoryUnavailableException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ThrottlingException`

  