Powershell Connect-AzureAD与连接有关的问题 [英] Powershell Connect-AzureAD problem with connection

查看:493
本文介绍了Powershell Connect-AzureAD与连接有关的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

因此,我拥有该服务帐户,该帐户应设置适当的权限才能连接到AzureAD.

So i have this service account that should have proper permissions set to connect to AzureAD. 

这是我使用的命令:

$username = "user@company.com"
$password = "password" | ConvertTo-SecureString -AsPlainText -Force

$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $password

$connect = Connect-AzureAD -Credential $credentials

但是当我尝试连接时,出现有趣的错误:

When i try to connect however i get interesting error:

" < Connect-AzureAD:发生一个或多个错误.:发送请求时发生错误."

" < Connect-AzureAD:无法从传输连接中读取数据:现有连接被远程主机强行关闭."

如果我尝试使用具有相同命令的个人帐户,就可以在一台计算机上进行连接,但是奇怪的是,在不同的设备上,我的个人帐户也会遇到相同的错误.

If i try using my personal account with the same commands i am able to connect on one machine, but strangely on different device i get the same errors for my personal account. 

我们将不胜感激.

推荐答案

您是否尝试过使用-TenantId参数指定租户的ID.如果未指定,则通常会通过家庭租户对帐户进行身份验证.
Have you tried using the -TenantId parameter to specify the ID of a tenant.  If you do not specify this, the account is normally authenticated with the home tenant.


这篇关于Powershell Connect-AzureAD与连接有关的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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