- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateMicrosoftADCommand
Creates a Microsoft AD directory in the Amazon Web Services Cloud. For more information, see Managed Microsoft AD in the Directory Service Admin Guide.
Before you call CreateMicrosoftAD, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the CreateMicrosoftAD operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DirectoryServiceClient, CreateMicrosoftADCommand } from "@aws-sdk/client-directory-service"; // ES Modules import
// const { DirectoryServiceClient, CreateMicrosoftADCommand } = require("@aws-sdk/client-directory-service"); // CommonJS import
const client = new DirectoryServiceClient(config);
const input = { // CreateMicrosoftADRequest
Name: "STRING_VALUE", // required
ShortName: "STRING_VALUE",
Password: "STRING_VALUE", // required
Description: "STRING_VALUE",
VpcSettings: { // DirectoryVpcSettings
VpcId: "STRING_VALUE", // required
SubnetIds: [ // SubnetIds // required
"STRING_VALUE",
],
},
Edition: "Enterprise" || "Standard",
Tags: [ // Tags
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
};
const command = new CreateMicrosoftADCommand(input);
const response = await client.send(command);
// { // CreateMicrosoftADResult
// DirectoryId: "STRING_VALUE",
// };
CreateMicrosoftADCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Name Required | string | undefined | The fully qualified domain name for the Managed Microsoft AD directory, such as |
Password Required | string | undefined | The password for the default administrative user named If you need to change the password for the administrator account, you can use the ResetUserPassword API call. |
VpcSettings Required | DirectoryVpcSettings | undefined | Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. |
Description | string | undefined | A description for the directory. This label will appear on the Amazon Web Services console |
Edition | DirectoryEdition | undefined | Managed Microsoft AD is available in two editions: |
ShortName | string | undefined | The NetBIOS name for your domain, such as |
Tags | Tag[] | undefined | The tags to be assigned to the Managed Microsoft AD directory. |
CreateMicrosoftADCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DirectoryId | string | undefined | The identifier of the directory that was created. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ClientException | client | A client exception has occurred. |
DirectoryLimitExceededException | client | The maximum number of directories in the region has been reached. You can use the GetDirectoryLimits operation to determine your directory limits in the region. |
InvalidParameterException | client | One or more parameters are not valid. |
ServiceException | server | An exception has occurred in Directory Service. |
UnsupportedOperationException | client | The operation is not supported. |
DirectoryServiceServiceException | Base exception class for all service exceptions from DirectoryService service. |