create_computer
async
¶
create_computer(
directory_id: DirectoryId,
computer_name: ComputerName,
password: ComputerPassword,
*,
config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
organizational_unit_distinguished_name: Optional[OrganizationalUnitDN] = None,
computer_attributes: Optional[Attributes] = None,
) -> CreateComputerResult
Creates an Active Directory computer object in the specified directory.
Parameters:
-
directory_id(DirectoryId) –The identifier of the directory in which to create the computer account.
-
computer_name(ComputerName) –The name of the computer account.
-
password(ComputerPassword) –A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.
-
organizational_unit_distinguished_name(Optional[OrganizationalUnitDN], default:None) –The fully-qualified distinguished name of the organizational unit to place the computer account in.
-
computer_attributes(Optional[Attributes], default:None) –An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
Raises:
-
AuthenticationFailedException–An authentication error occurred.
-
ClientException–A client exception has occurred.
-
DirectoryUnavailableException–The specified directory is unavailable.
-
EntityAlreadyExistsException–The specified entity already exists.
-
EntityDoesNotExistException–The specified entity could not be found.
-
InvalidParameterException–One or more parameters are not valid.
-
ServiceException–An exception has occurred in Directory Service.
-
UnsupportedOperationException–The operation is not supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a computer account The following example creates a computer account in the specified directory, and joins the computer to the directory.
>>> await client.create_computer(directory_id='d-92654abfed', computer_name='labcomputer', password='Str0ngP@ssw0rd', organizational_unit_distinguished_name='OU=Computers,OU=example,DC=corp,DC=example,DC=com', computer_attributes=[{'Name': 'ip', 'Value': '192.168.101.100'}])
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | |