Skip to content

Instantly share code, notes, and snippets.

@Torxsmind
Created March 6, 2020 18:11
Show Gist options
  • Select an option

  • Save Torxsmind/7261b5c8b339e5214ea4eaf1163d6174 to your computer and use it in GitHub Desktop.

Select an option

Save Torxsmind/7261b5c8b339e5214ea4eaf1163d6174 to your computer and use it in GitHub Desktop.
Azure Get MFA Default Method
import-module MSOnline
Connect-MsolService
$now = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$filepath = 'C:\temp\MFA_Users_' + $now + '.csv'
Get-MsolUser -All | Select-Object UserPrincipalName, DisplayName, Title,
@{n="MFA"; e={$_.StrongAuthenticationRequirements.State}},
@{n="Default Method"; e={($_.StrongAuthenticationMethods | where-object isdefault -eq 'true').MethodType}},
@{n="Methods"; e={($_.StrongAuthenticationMethods).MethodType}} | Export-Csv -Path $filepath -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment