Skip to content

Instantly share code, notes, and snippets.

@jorke
Created February 15, 2019 00:25
Show Gist options
  • Save jorke/bca99132a0d1f6b02a756445931dda06 to your computer and use it in GitHub Desktop.
Save jorke/bca99132a0d1f6b02a756445931dda06 to your computer and use it in GitHub Desktop.
force iam user to reset password
for x in $(aws iam list-users --output text --query 'Users[*].UserName');
do
echo "$x?"
read choice
case "$choice" in
y|Y ) echo $(aws iam update-login-profile --user-name $x --password-reset-required);;
n|N ) echo "no";;
* ) echo "invalid";;
esac
;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment