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-IAMEntitiesForPolicy-PolicyArn <String>-EntityFilter <EntityType>-PathPrefix <String>-PolicyUsageFilter <PolicyUsageType>-Marker <String>-MaxItem <Int32>-Select <String>
EntityFilter
parameter to limit the results to a particular type of entity (users, groups, or roles). For example, to list only the roles that are attached to the specified policy, set EntityFilter
to Role
.
You can paginate the results using the MaxItems
and Marker
parameters. EntityFilter
is Role
, only the roles that are attached to the specified policy are returned. This parameter is optional. If it is not included, all attached entities (users, groups, and roles) are returned. The argument for this parameter must be one of the valid values listed below. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
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 |
\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) |
Required? | True |
Position? | 2 |
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) |
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-IAMEntitiesForPolicy -PolicyArn "arn:aws:iam::123456789012:policy/TestPolicy"
IsTruncated : False
Marker :
PolicyGroups : {}
PolicyRoles : {testRole}
PolicyUsers : {Bob, Theresa}This example returns a list of IAM groups, roles, and users who have the policyarn:aws:iam::123456789012:policy/TestPolicy
attached.
AWS Tools for PowerShell: 2.x.y.z