使用PowerShell在线连接到Microsoft Exchange的问题 - 仅应用身份验证

发布于 2025-01-17 13:15:52 字数 690 浏览 2 评论 0原文

我无法连接到 Exchange Online,连接时出现以下错误

获取令牌时出错: System.Exception:对于联合用户(由联合 IdP 拥有,而不是 Azure AD 租户中拥有的托管用户) ID3242:安全令牌无法进行身份验证或授权。用户不存在或输入了错误的密码 SwordInnerException:联合服务

PowerShell代码

$AppCredential= New-Object System.Management.Automation.PSCredential(<UPN>,<Token>)

Connect-ExchangeOnline -Credential $AppCredential

参考

https://o365reports.com/2020/07/04/modern-auth-and-unattended-scripts-in-exchange-online-powershell-v2/

I could not connect to Exchange Online, I get the below error while connecting

Error Acquiring Token:
System.Exception: In the case of a Federated user(that is owned by a federated IdP, as opposed to a managed user owned in an Azure AD tenant)
ID3242: The security token could not be authenticated or authorized.The user does not exist or has entered the wrong pas
swordInnerException : Federated service

PowerShell Code

$AppCredential= New-Object System.Management.Automation.PSCredential(<UPN>,<Token>)

Connect-ExchangeOnline -Credential $AppCredential

Reference

https://o365reports.com/2020/07/04/modern-auth-and-unattended-scripts-in-exchange-online-powershell-v2/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看海 2025-01-24 13:15:52

使用仅应用程序身份验证连接到 Exchange Online EXO V2 中不提供此功能。

仅应用程序身份验证无法进行委派。安全应用程序模型允许在委派方案中进行无人值守的脚本编写。

此功能不支持委派。

注意:将您的 EXO V2 降低为 V1,然后您可以使用相同的脚本通过仅应用程序身份验证连接 E​​xchange Online。。但不推荐这种方式。

请参阅 此处

Connect to Exchange Online using App-only authentication Feature is not available in EXO V2.

Delegation is not possible with app-only authentication. The Secure App Model allows for unattended scripting in delegation scenarios.

Delegation is not supported in this Feature.

Note: Decrease your EXO V2 into V1 then you can use the same scripts to connect the Exchange Online using APP-only Authentication.. But This way is not recommended.

Refer here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文