DescribeDirectories - Amazon Directory Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Obtains information about the directories that belong to this account.

You can retrieve information about specific directories by passing the directory identifiers in the DirectoryIds parameter. Otherwise, all directories that belong to the current account are returned.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeDirectoriesResult.NextToken member contains a token that you pass in the next call to DescribeDirectories to retrieve the next set of items.

You can also specify a maximum number of return results with the Limit parameter.

Request Syntax

{ "DirectoryIds": [ "string" ], "Limit": number, "NextToken": "string" }

Request Parameters

The request accepts the following data in JSON format.


A list of identifiers of the directories for which to obtain the information. If this member is null, all directories that belong to the current account are returned.

An empty list results in an InvalidParameterException being thrown.

Type: Array of strings

Pattern: ^d-[0-9a-f]{10}$

Required: No


The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.

Type: Integer

Valid Range: Minimum value of 0.

Required: No


The DescribeDirectoriesResult.NextToken value from a previous call to DescribeDirectories. Pass null if this is the first call.

Type: String

Required: No

Response Syntax

{ "DirectoryDescriptions": [ { "AccessUrl": "string", "Alias": "string", "ConnectSettings": { "AvailabilityZones": [ "string" ], "ConnectIps": [ "string" ], "CustomerUserName": "string", "SecurityGroupId": "string", "SubnetIds": [ "string" ], "VpcId": "string" }, "Description": "string", "DesiredNumberOfDomainControllers": number, "DirectoryId": "string", "DnsIpAddrs": [ "string" ], "Edition": "string", "LaunchTime": number, "Name": "string", "OsVersion": "string", "OwnerDirectoryDescription": { "AccountId": "string", "DirectoryId": "string", "DnsIpAddrs": [ "string" ], "RadiusSettings": { "AuthenticationProtocol": "string", "DisplayLabel": "string", "RadiusPort": number, "RadiusRetries": number, "RadiusServers": [ "string" ], "RadiusTimeout": number, "SharedSecret": "string", "UseSameUsername": boolean }, "RadiusStatus": "string", "VpcSettings": { "AvailabilityZones": [ "string" ], "SecurityGroupId": "string", "SubnetIds": [ "string" ], "VpcId": "string" } }, "RadiusSettings": { "AuthenticationProtocol": "string", "DisplayLabel": "string", "RadiusPort": number, "RadiusRetries": number, "RadiusServers": [ "string" ], "RadiusTimeout": number, "SharedSecret": "string", "UseSameUsername": boolean }, "RadiusStatus": "string", "RegionsInfo": { "AdditionalRegions": [ "string" ], "PrimaryRegion": "string" }, "ShareMethod": "string", "ShareNotes": "string", "ShareStatus": "string", "ShortName": "string", "Size": "string", "SsoEnabled": boolean, "Stage": "string", "StageLastUpdatedDateTime": number, "StageReason": "string", "Type": "string", "VpcSettings": { "AvailabilityZones": [ "string" ], "SecurityGroupId": "string", "SubnetIds": [ "string" ], "VpcId": "string" } } ], "NextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The list of DirectoryDescription objects that were retrieved.

It is possible that this list contains less than the number of items specified in the Limit member of the request. This occurs if there are less than the requested number of items left to retrieve, or if the limitations of the operation have been exceeded.

Type: Array of DirectoryDescription objects


If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeDirectories to retrieve the next set of items.

Type: String


For information about the errors that are common to all actions, see Common Errors.


A client exception has occurred.

HTTP Status Code: 400


The specified entity could not be found.

HTTP Status Code: 400


The NextToken value is not valid.

HTTP Status Code: 400


One or more parameters are not valid.

HTTP Status Code: 400


An exception has occurred in Amazon Directory Service.

HTTP Status Code: 500


The following examples are formatted for legibility.

Example Request

This example illustrates one usage of DescribeDirectories.

POST / HTTP/1.1 Host: Accept-Encoding: identity Content-Length: 46 X-Amz-Target: DirectoryService_20150416.DescribeDirectories X-Amz-Date: 20161214T022424Z User-Agent: aws-cli/1.11.24 Python/2.7.9 Windows/7 botocore/1.4.81 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI7E3BYXS3example/20161214/us-west-2/ds/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=4e138f2c34fe61b203c621e69264a9347db842b944df2eb88fce7e2c337eab8c { "DirectoryIds": "d-926example", "Limit": 0 }

Example Response

This example illustrates one usage of DescribeDirectories.

HTTP/1.1 200 OK x-amzn-RequestId: 6f884e4a-c1a4-11e6-a099-03078e35561b Content-Type: application/x-amz-json-1.1 Content-Length: 470 Date: Wed, 14 Dec 2016 02:24:27 GMT { "DirectoryDescriptions":[ { "AccessUrl":"", "Alias":"myaccess", "DirectoryId":"d-926example", "DnsIpAddrs":[ "", "" ], "LaunchTime":1.469737584772E9, "Name":"", "ShortName":"example", "SsoEnabled":true, "Stage":"Active", "StageLastUpdatedDateTime":1.46973913171E9, "Type":"MicrosoftAD", "VpcSettings":{ "AvailabilityZones":[ "us-west-2a", "us-west-2b" ], "SubnetIds":[ "subnet-ba0146de", "subnet-bef46bc8" ], "VpcId":"vpc-45025421" } } ] }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: