I have this PowerShell comand that I don't quite understand:
Get-MsolUser -all | select DisplayName,UserPrincipalName,@{N="MFA Status"; E={ if( $_.StrongAuthenticationMethods.IsDefault -eq $true) {($_.StrongAuthenticationMethods | Where IsDefault -eq $True).MethodType} else { "Disabled"}}} | FT -AutoSize
Can someone please explain what @{N="MFA Status"; E=
@{N="MFA Status"; E=
stands for?
This is related to calculated properties - here is some good examples: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ff730948(v=technet.10)?redirectedfrom=MSDN#using-calculated-properties
N stands for Name as in what the property will be called in the list produced - can be whatever you want it to be
E for Expression where you do the voodoo to calculate this new value
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.