AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Get-IAMPolicyList-OnlyAttached <Boolean>-PathPrefix <String>-PolicyUsageFilter <PolicyUsageType>-Scope <PolicyScopeType>-Marker <String>-MaxItem <Int32>-Select <String>-NoAutoIteration <SwitchParameter>
OnlyAttached
, Scope
, and PathPrefix
parameters. For example, to list only the customer managed policies in your Amazon Web Services account, set Scope
to Local
. To list only Amazon Web Services managed policies, set Scope
to AWS
.
You can paginate the results using the MaxItems
and Marker
parameters.
For more information about managed policies, see Managed policies and inline policies in the IAM User Guide.
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a customer manged policy, see GetPolicy. Marker
element in the response that you received to indicate where the next call should start.Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | NextToken |
IsTruncated
response element is true
.If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated
response element returns true
, and Marker
contains a value to include in the subsequent call that tells the service where to continue from.Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | MaxItems |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
OnlyAttached
is true
, the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached
is false
, or when the parameter is not included, all policies are returned. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
\u0021
) through the DEL character (\u007F
), including most punctuation characters, digits, and upper and lowercased letters. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
PolicyUsageFilter
to PermissionsPolicy
. To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary
.This parameter is optional. If it is not included, all policies are returned. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Scope
to AWS
. To list only the customer managed policies in your Amazon Web Services account, set Scope
to Local
.This parameter is optional. If it is not included, or if it is set to All
, all policies are returned. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
Get-IAMPolicyList -MaxItem 3
Arn : arn:aws:iam::aws:policy/AWSDirectConnectReadOnlyAccess
AttachmentCount : 0
CreateDate : 2/6/2015 10:40:08 AM
DefaultVersionId : v1
Description :
IsAttachable : True
Path : /
PolicyId : Z27SI6FQMGNQ2EXAMPLE1
PolicyName : AWSDirectConnectReadOnlyAccess
UpdateDate : 2/6/2015 10:40:08 AM
Arn : arn:aws:iam::aws:policy/AmazonGlacierReadOnlyAccess
AttachmentCount : 0
CreateDate : 2/6/2015 10:40:27 AM
DefaultVersionId : v1
Description :
IsAttachable : True
Path : /
PolicyId : NJKMU274MET4EEXAMPLE2
PolicyName : AmazonGlacierReadOnlyAccess
UpdateDate : 2/6/2015 10:40:27 AM
Arn : arn:aws:iam::aws:policy/AWSMarketplaceFullAccess
AttachmentCount : 0
CreateDate : 2/11/2015 9:21:45 AM
DefaultVersionId : v1
Description :
IsAttachable : True
Path : /
PolicyId : 5ULJSO2FYVPYGEXAMPLE3
PolicyName : AWSMarketplaceFullAccess
UpdateDate : 2/11/2015 9:21:45 AMThis example returns a collection of the first three managed policies available in the current AWS account. Because-scope
is not specified, it defaults toall
and includes both AWS managed and customer managed policies.
Get-IAMPolicyList -Scope local -MaxItem 2
Arn : arn:aws:iam::123456789012:policy/MyLocalPolicy
AttachmentCount : 0
CreateDate : 2/12/2015 9:39:09 AM
DefaultVersionId : v2
Description :
IsAttachable : True
Path : /
PolicyId : SQVCBLC4VAOUCEXAMPLE4
PolicyName : MyLocalPolicy
UpdateDate : 2/12/2015 9:39:53 AM
Arn : arn:aws:iam::123456789012:policy/policyforec2instancerole
AttachmentCount : 1
CreateDate : 2/17/2015 2:51:38 PM
DefaultVersionId : v11
Description :
IsAttachable : True
Path : /
PolicyId : X5JPBLJH2Z2SOEXAMPLE5
PolicyName : policyforec2instancerole
UpdateDate : 2/18/2015 8:52:31 AMThis example returns a collection of the first two customer managed policies available in current AWS account. It uses-Scope local
to limit the output to only customer managed policies.
AWS Tools for PowerShell: 2.x.y.z