AWS Identity and Access Management
CLI Reference (API Version 2010-05-08)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

iam-userlistbypath

Description

Lists the users that have the specified path prefix, or lists all the users in the AWS account. If none exist, the action still succeeds. You can paginate the results using the MaxItems and Marker options.

Syntax

iam-userlistbypath [-p PATH]

Options

Name Description Required

-p PATH

The path prefix for filtering the results. For example, /division_abc/subdivision_xyz/ would get all users whose path starts with /division_abc/subdivision_xyz/.

Type: String

Default: /

Condition: Provide this option only if you want to list the users with a specific path prefix.

Conditional

-i MAXITEMS

Use this only when paginating results to indicate the maximum number of items you want in the response. If there are additional items beyond the maximum you specify, the IsTruncated response element is true. This parameter is optional.  If you don't include it, it defaults to 100.

Type: String

Default: None

No

-m MARKER

Use this only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.

Type: String

Default: None

No

Output

The output lists the Amazon Resource Name (ARN) for each resulting user.

Examples

The following example lists all the users in the AWS account.

PROMPT> iam-userlistbypath 
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Bob
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Susan
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/John
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/engineering/Andrew
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/engineering/Jackie

The following example lists all the users whose path starts with /division_abc/subdivision_xyz/.

PROMPT> iam-userlistbypath -p /division_abc/subdivision_xyz/
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Bob
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Susan
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/John

Related Commands