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

See CreateMicrosoftADCommandInput for more details

Parameter
Type
Description
Name
Required
string | undefined

The fully qualified domain name for the Managed Microsoft AD directory, such as corp.example.com. This name will resolve inside your VPC only. It does not need to be publicly resolvable.

Password
Required
string | undefined

The password for the default administrative user named Admin.

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 Directory Details page after the directory is created.

Edition
DirectoryEdition | undefined

Managed Microsoft AD is available in two editions: Standard and Enterprise. Enterprise is the default.

ShortName
string | undefined

The NetBIOS name for your domain, such as CORP. If you don't specify a NetBIOS name, it will default to the first part of your directory DNS. For example, CORP for the directory DNS corp.example.com.

Tags
Tag[] | undefined

The tags to be assigned to the Managed Microsoft AD directory.

CreateMicrosoftADCommand Output

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
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.