从Powershell连接到Azure AD而没有提示 [英] Connect to Azure AD from Powershell without prompt

查看:76
本文介绍了从Powershell连接到Azure AD而没有提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个启用了多因素身份验证的Azure AD帐户,并且想知道是否有一种方法可以通过Powershell在没有提示的情况下进行连接,即没有MFA.

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.

我们已经尝试过Connect-AzureAD -Credentials,但是在设置MFA时它不会继续进行:

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

AADSTS50076:由于进行了配置更改 由您的管理员决定,或者因为您已移至新位置,所以必须使用多因素 身份验证以访问...

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...

如果有任何方法可以设置MFA并通过Powershell进行连接,将不胜感激.

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

推荐答案

否.如果需要MFA,则无法以用户身份以编程方式登录.

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

在这种情况下,需要交互式身份验证.

Interactive authentication is required in that case.

如果您更改策略以允许从没有MFA的计算机进行身份验证,那么它将起作用.

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.

这篇关于从Powershell连接到Azure AD而没有提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆