Forum Discussion
StuartK73
Aug 06, 2019Iron Contributor
Report Users with NO Alternative Authentication Phone
Hi All Is it possible to create a report showing users with / without an Alternative Authentication Phone Number? Info greatly appreciated
- Aug 09, 2019
Can you try the below script to list all users without alternative auth phone number.
$Result=@() $users = Get-MsolUser -All $users | ForEach-Object { $user = $_ $alternativePhoneNumber = $user.StrongAuthenticationUserDetails.AlternativePhoneNumber if($alternativePhoneNumber -eq $null) { $Result += New-Object PSObject -property @{ UserName = $user.DisplayName UserPrincipalName = $user.UserPrincipalName } } } $Result | Select UserName,UserPrincipalName
Or you can try below script to list only MFA enabled users without alternative auth phone.
$Result=@() $users = Get-MsolUser -All | Where {$_.StrongAuthenticationMethods -ne $null -or $_.StrongAuthenticationRequirements.State -ne $nul} $users | ForEach-Object { $user = $_ $alternativePhoneNumber = $user.StrongAuthenticationUserDetails.AlternativePhoneNumber if($alternativePhoneNumber -eq $null) { $Result += New-Object PSObject -property @{ UserName = $user.DisplayName UserPrincipalName = $user.UserPrincipalName } } } $Result | Select UserName,UserPrincipalName
StuartK73
Aug 09, 2019Iron Contributor
Hi Kevin
Yes this works, it displays my alternative mob number.
Can this be done tenant wide?
Stuart
Kevin_Morgan
Aug 09, 2019Iron Contributor
Can you try the below script to list all users without alternative auth phone number.
$Result=@() $users = Get-MsolUser -All $users | ForEach-Object { $user = $_ $alternativePhoneNumber = $user.StrongAuthenticationUserDetails.AlternativePhoneNumber if($alternativePhoneNumber -eq $null) { $Result += New-Object PSObject -property @{ UserName = $user.DisplayName UserPrincipalName = $user.UserPrincipalName } } } $Result | Select UserName,UserPrincipalName
Or you can try below script to list only MFA enabled users without alternative auth phone.
$Result=@() $users = Get-MsolUser -All | Where {$_.StrongAuthenticationMethods -ne $null -or $_.StrongAuthenticationRequirements.State -ne $nul} $users | ForEach-Object { $user = $_ $alternativePhoneNumber = $user.StrongAuthenticationUserDetails.AlternativePhoneNumber if($alternativePhoneNumber -eq $null) { $Result += New-Object PSObject -property @{ UserName = $user.DisplayName UserPrincipalName = $user.UserPrincipalName } } } $Result | Select UserName,UserPrincipalName
- StuartK73Aug 09, 2019Iron Contributor
2nd script looks good.
Your an absolute genius, thank you so much.
Marked your answer as the Best Response.
Have yourself a fab day.
Stuart