ServiceAdministrator、AccountAdministrator和CoAdministrator角色的用户是Azure中的经典管理员。我们正在尝试为这些经典管理员用户获取MFA状态。但是,在PowerShell中使用">Get-MsolUser-UserPrincipalName{classicAdminSignInName}",我们不会得到任何用户。此外,从Azure门户在Azure AD中搜索时也找不到经典管理员用户。关于上述情况,能否请您帮助我们理解。如何使用PowerShell获取经典管理员的MFA状态?
这不是获得ADUser UPN的方式。你会这么做的。。。
Get-MsolUser -UserPrincipalName SomeUserName@SomeDomain.com
不需要大括号,除非您要使用Where过滤。
Get-MsolUser |
Where-Object { $_.isLicensed -eq "TRUE" } |
Select UserPrincipalName
就像你在prem ADDS中通过Get-ADUser这样做一样。
搜索你的用例会显示你需要注意的项目:
"获取azure用户mfa状态">
点击示例:
Azure Multi-Factor Authentication用户状态
Powershell脚本,用于获取MFA状态为的用户列表
识别已配置MFA的用户:
Get-MsolUser -all |
select UserPrincipalName,
@{N="MFA Status"; E={ if( $_.StrongAuthenticationMethods.IsDefault -eq $true) {($_.StrongAuthenticationMethods|Where IsDefault -eq $True).MethodType}
else { "Disabled"}}} |
FT -AutoSize