Skip to content

Instantly share code, notes, and snippets.

View kalpik's full-sized avatar

Kalpik Nigam kalpik

View GitHub Profile
@kalpik
kalpik / Enforce-MFA.ps1
Created January 9, 2020 12:09
A small script to enforce users to use MFA, while not requiring it for API access
Import-Module -Name AWSPowerShell.NetCore
$users = Get-IAMUserList
foreach($user in $users.UserName)
{
# Do not add API-only users to MFA jail
try {
$null = Get-IAMLoginProfile -UserName $user
}