AWS code-library documentation change
Summary
Added PowerShell V5 examples for user group membership removal
Security assessment
Illustrates user access management, a security practice, but no evidence of addressing a security vulnerability.
Diff
diff --git a/code-library/latest/ug/iam_example_iam_RemoveUserFromGroup_section.md b/code-library/latest/ug/iam_example_iam_RemoveUserFromGroup_section.md index 13e819bbe..08b95b1cc 100644 --- a//code-library/latest/ug/iam_example_iam_RemoveUserFromGroup_section.md +++ b//code-library/latest/ug/iam_example_iam_RemoveUserFromGroup_section.md @@ -65,0 +66,27 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example removes the IAM user`Bob` from the group `Testers`. ** + + + Remove-IAMUserFromGroup -GroupName Testers -UserName Bob + + +**Example 2: This example finds any groups of which IAM user`Theresa` is a member, and then removes `Theresa` from those groups.** + + + $groups = Get-IAMGroupForUser -UserName Theresa + foreach ($group in $groups) { Remove-IAMUserFromGroup -GroupName $group.GroupName -UserName Theresa -Force } + + +**Example 3: This example shows an alternate way of removing the IAM user`Bob` from the `Testers` group.** + + + Get-IAMGroupForUser -UserName Bob | Remove-IAMUserFromGroup -UserName Bob -GroupName Testers -Force + + + * For API details, see [RemoveUserFromGroup](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +