Skip to content

Instantly share code, notes, and snippets.

@dstreefkerk
Created January 9, 2019 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstreefkerk/1e169f5d236614ddf0628ac360f34a61 to your computer and use it in GitHub Desktop.
Save dstreefkerk/1e169f5d236614ddf0628ac360f34a61 to your computer and use it in GitHub Desktop.
List all users that have SMS or Phone call as their default MFA method.
Connect-MsolService
$allUsers = Get-MsolUser -MaxResults 100000
$usersWithSmsOrPhoneMfa = @()
foreach ($user in $allUsers) {
foreach ($method in $user.StrongAuthenticationMethods) {
if (($method.MethodType -eq 'OneWaySMS') -or ($method.MethodType -eq 'PhoneAppNotification')) {
if ($method.IsDefault) { $usersWithSmsOrPhoneMfa += $user }
}
}
}
$usersWithSmsOrPhoneMfa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment