create_computer
¶
create_computer(
directory_id: DirectoryId,
computer_name: ComputerName,
password: ComputerPassword,
*,
config_overrides: Optional[DirectoryServiceClientConfig] = 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.
>>> 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/directory_service.py
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | |