AWS code-library documentation change
Summary
Added PowerShell V5 examples for detaching user policies
Security assessment
Demonstrates standard user permission management without addressing specific security issues.
Diff
diff --git a/code-library/latest/ug/iam_example_iam_DetachUserPolicy_section.md b/code-library/latest/ug/iam_example_iam_DetachUserPolicy_section.md index 191be5699..5ad1e1fb1 100644 --- a//code-library/latest/ug/iam_example_iam_DetachUserPolicy_section.md +++ b//code-library/latest/ug/iam_example_iam_DetachUserPolicy_section.md @@ -65,0 +66,20 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example detaches the managed policy whose ARN is`arn:aws:iam::123456789012:policy/TesterPolicy` from the IAM user named `Bob`.** + + + Unregister-IAMUserPolicy -UserName Bob -PolicyArn arn:aws:iam::123456789012:policy/TesterPolicy + + +**Example 2: This example finds all the managed policies that are attached to the IAM user named`Theresa` and detaches those policies from the user.** + + + Get-IAMAttachedUserPolicyList -UserName Theresa | Unregister-IAMUserPolicy -Username Theresa + + + * For API details, see [DetachUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +