Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to Azure AD from Powershell without prompt

We have an Azure AD account with Multi Factor Authentication enabled and are wondering if there is a way we connect to it without a prompt, that is without MFA, through Powershell.

We've tried Connect-AzureAD -Credentials however it doesn't proceed when MFA is setup:

AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access...

If there is any way to have MFA setup and connect through Powershell that would be much appreciated.

like image 906
user3167162 Avatar asked Sep 15 '25 07:09

user3167162


1 Answers

No. If MFA is required, you cannot sign in programmatically as a user.

Interactive authentication is required in that case.

If you change your policies to allow authentication from that machine without MFA, then it will work.

You can also use a service principal for authentication instead of a user.

like image 178
juunas Avatar answered Sep 17 '25 20:09

juunas