Created
January 9, 2019 04:53
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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