Saturday, January 18, 2020

MFA enabled/disabled users from using Global access policy


Once the reports gets generated, Sort-out the reports based on the "MFA Methods" will provide the report for people registered with MFA or Not.


Get-msoluser -All | Select-Object @{N='UserPrincipalName';E={$_.UserPrincipalName}},
@{N='MFA Status';E={if ($_.StrongAuthenticationRequirements.State){$_.StrongAuthenticationRequirements.State} else {"Disabled"}}},
@{N='MFA Methods';E={$_.StrongAuthenticationMethods.methodtype}},
@{N='Auth Email';E={$_.StrongAuthenticationUserDetails.email}},
@{N='Auth Phone';E={$_.StrongAuthenticationUserDetails.PhoneNumber}},
@{N='Auth Device';E={$_.StrongAuthenticationPhoneAppDetails.DeviceName}},
@{N='Alternative Phone';E={$_.StrongAuthenticationUserDetails.AlternativePhoneNumber}},
@{N='Alternative Email';E={$_.AlternateEmailAddresses}} Export-Csv -Path C:\Temp\MFA_Report.csv -NoTypeInformation




or 


Get-msoluser -All | Select-Object @{N='UserPrincipalName';E={$_.UserPrincipalName}},

@{N='MFA Status';E={if ($_.StrongAuthenticationRequirements.State){$_.StrongAuthenticationRequirements.State} else {"Disabled"}}},
@{N='MFA Methods';E={$_.StrongAuthenticationMethods.methodtype}},
@{N='Auth Email';E={$_.StrongAuthenticationUserDetails.email}},
@{N='Auth Phone';E={$_.StrongAuthenticationUserDetails.PhoneNumber}},
@{N='Auth Device';E={$_.StrongAuthenticationPhoneAppDetails.DeviceName}},
@{N='Alternative Phone';E={$_.StrongAuthenticationUserDetails.AlternativePhoneNumber}},
@{N='Alternative Email';E={$_.AlternateEmailAddresses}} | Out-GridView

Wednesday, January 15, 2020

Get and Set-AzureADUserExtension to find the users property

Guest B2 B account user does not has few extension property value like employeeId and others , understanding this , We need to use set command to push the value to guest account.

Set-AzureADUserExtension -ObjectId 0fc8c68a-9fb7-4ddd-ac3b-3d3c8bd26b2a -ExtensionName "employeeid" -ExtensionValue "1001" 

Get-AzureADUser -ObjectId fde1c840-25ac-4332-a47a-54a1f18a4463 | FL



HTML

Script:

JS