I am trying to display StrongAuthenticationMethods from the azure object (user) in a more readable way inside of the script which will reset the MFA method.
When I call variable $mfa
$UserPname = Read-Host "Please enter e-mail address"
$AzureUser=Get-MsolUser -UserPrincipalName "$UserPname"
$methode = $AzureUser.StrongAuthenticationMethods
$mfa = $methode | Select-Object MethodType, IsDefault
$mfa
it gives me a nice table:
---------- ---------
PhoneAppOTP False
PhoneAppNotification True
When I try to write-host this variable:
Write-Host $mfa
It gives me:
Write-Host $mfa
@{MethodType=PhoneAppOTP; IsDefault=False} @{MethodType=PhoneAppNotification; IsDefault=
True}
How can I display this MethodType and IsDefault properties in the best readable way using write-host?
Thanks for the information in advance!