Hi all,
I'm looking for guidance on how to produce a power shell report on users that have MFA disabled in a certain OU. If tried the below and changed the OU and DC to mine, but it errors
$Users = Get-ADUser -Filter * -SearchBase 'OU=OUName,DC=Domain,DC=Com' |
Select-Object -ExpandProperty UserPrincipalName
$Results = foreach( $User in $Users ){
Get-MsolUser -UserPrincipalName $User |
Select-Object -Property UserPrincipalName, @{
Name = 'MFA State'
Expression = { $_.StrongAuthenticationRequirements.State }
}
}
$Results |
Export-Csv -Path 'C:\Temp\Report.csv' -NoTypeInformation
Any help would be appreciated.
Thanks
I'm looking for guidance on how to produce a power shell report on users that have MFA disabled in a certain OU. If tried the below and changed the OU and DC to mine, but it errors
$Users = Get-ADUser -Filter * -SearchBase 'OU=OUName,DC=Domain,DC=Com' |
Select-Object -ExpandProperty UserPrincipalName
$Results = foreach( $User in $Users ){
Get-MsolUser -UserPrincipalName $User |
Select-Object -Property UserPrincipalName, @{
Name = 'MFA State'
Expression = { $_.StrongAuthenticationRequirements.State }
}
}
$Results |
Export-Csv -Path 'C:\Temp\Report.csv' -NoTypeInformation
Any help would be appreciated.
Thanks