Forum Discussion
Powershell CMDlets for MFA Settings?
- Feb 13, 2018
You have the information in the Get-MSolUser cmdlet from MSOnline powershell module:
Connect-MsolService $User = Get-MSolUser -UserPrincipalName user@domain.com
$User.StrongAuthenticationMethodsWith that you get the default authentication method. There are other properties beginning by StrongAuthentication that give you other details
You have the information in the Get-MSolUser cmdlet from MSOnline powershell module:
Connect-MsolService $User = Get-MSolUser -UserPrincipalName user@domain.com
$User.StrongAuthenticationMethods
With that you get the default authentication method. There are other properties beginning by StrongAuthentication that give you other details
I need a PS script that generates a CSV showing not only if MFA is enabled for all users, but shows the authentication method as well.
Thank You in advance.
- MichalZiembaOct 22, 2020MCT
Here is the script which does exactly what you need
https://docs.microsoft.com/en-us/samples/azure-samples/azure-mfa-authentication-method-analysis/azure-mfa-authentication-method-analysis/ - Gary LongMay 31, 2018Copper Contributor
Try this (has to be done on a per-group basis):
$filepath = '<your-export-filename>'
Get-MsolGroupMember -GroupObjectId <the id number of the group> -MemberObjectTypes User -All | Get-MsolUser | Where {$_.UserPrincipalName} | Select UserPrincipalName, DisplayName, Country, Department, Title, @{n="MFA"; e={$_.StrongAuthenticationRequirements.State}}, @{n="Methods"; e={($_.StrongAuthenticationMethods).MethodType}}, @{n="Default Method"; e={($_.StrongAuthenticationMethods).IsDefault}} | Export-Csv -Path $filepath- Dale RobertsonMay 31, 2018Copper Contributor
Thank You.
So by Group, do you mean all the users must be in some type of GROUP?
[Distro, O365 Group,..]
- Gary LongMay 31, 2018Copper Contributor
This specific PS command relies upon the Group Object ID which is unique to the specific group. For instance, if you have an All Users group, you would need to provide. It's a number that looks similar to this: af407072-7ae1-4b07-a0ca-6634b7396054