describe_user
async
¶
describe_user(
directory_id: DirectoryId,
sam_account_name: UserName,
*,
config_overrides: Optional[AsyncDirectoryServiceDataClientConfig] = None,
other_attributes: Optional[LdapDisplayNameList] = None,
realm: Optional[Realm] = None,
) -> DescribeUserResult
Returns information about a specific user.
Parameters:
-
directory_id(DirectoryId) –The identifier (ID) of the directory that's associated with the user.
-
sam_account_name(UserName) –The name of the user.
-
other_attributes(Optional[LdapDisplayNameList], default:None) –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.
-
realm(Optional[Realm], default:None) –The domain name that's associated with the user.
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.
Raises:
-
AccessDeniedException–You don't have permission to perform the request or access the directory. It can also occur when the
DirectoryIddoesn't exist or the user, member, or group might be outside of your organizational unit (OU).Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.
-
DirectoryUnavailableException–The request could not be completed due to a problem in the configuration or current state of the specified directory.
-
InternalServerException–The operation didn't succeed because an internal error occurred. Try again later.
-
ResourceNotFoundException–The resource couldn't be found.
-
ThrottlingException–The limit on the number of requests per second has been exceeded.
-
ValidationException–The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To return the attributes of a user The following command returns the mapped attributes for a user along with the department, manager, IP phone, and date the user last set a password.
>>> await client.describe_user(directory_id='d-12233abcde', other_attributes=['department', 'manager', 'ipPhone', 'pwdLastSet'], realm='examplecorp.com', sam_account_name='twhitlock')
Source code in docs_src/capo_directory_service_data/_services/async_directory_service_data.py
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 | |