Forum Discussion
madankumarinfrassist
Nov 11, 2021Copper Contributor
Enable Conditional Access policies to block legacy authentication(PowerShell)
 I need to automate Conditional Access policies to block legacy authentication.  So I am facing challenges in PowerShell scripts.  why? Legacy authentication protocols do not support multi-factor auth...
Nov 11, 2021
So... You want to disable legacy authentication in your tenant by using Conditional Access? (https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/block-legacy-authentication) And you want to use PowerShell scripts to create those Conditional Access policies, but you can't? Did you try https://practical365.com/using-powershell-to-manage-conditional-access-ca-policies/ ?
Or.. Do you want to keep on using PowerShell scripts and think that you can't anymore after enabling Conditional Access rules blocking legacy authentication? For Exchange Online for example you can use certifcate based authentication (https://thecloudtechnologist.com/2020/09/05/use-powershell-to-connect-to-exchange-online-unattended-in-a-scheduled-task/) or with a Service Principal (https://docs.microsoft.com/en-us/powershell/azure/active-directory/signing-in-service-principal?view=azureadps-2.0)
Or.. Do you want to keep on using PowerShell scripts and think that you can't anymore after enabling Conditional Access rules blocking legacy authentication? For Exchange Online for example you can use certifcate based authentication (https://thecloudtechnologist.com/2020/09/05/use-powershell-to-connect-to-exchange-online-unattended-in-a-scheduled-task/) or with a Service Principal (https://docs.microsoft.com/en-us/powershell/azure/active-directory/signing-in-service-principal?view=azureadps-2.0)