Connect-MsolService:收到对https://provisioningapi.microsoftonline.com/provisioningwebservice.svc的HTTP响应时发生错误

时间:2019-01-06 04:56:42

标签: powershell

我正在尝试从UAT enviornemnt连接Connect-MsolService,并将其作为代理配置。我们已经使用netsh winhttp设置了代理。我的代理也具有http://myproxy:8080在IE中配置的相同名称。我们能够访问互联网。但是当我使用powerhshell来连接MsolService时出现以下错误

我在调用命令之前设置了代理。我使用代理accessType并传递给会话选项。什么都没用。

$credential = get-credential "idms@mycompany.onmicrosoft.com"
$sessionoption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell-liveid -Credential $LiveCred   -Authentication Basic -AllowRedirection

它应该连接并查询数据。但是出错了

Connect-MsolService : An error occurred while receiving the HTTP response to https://provisioningapi.microsoftonline.com/provisioningwebservice.svc. This 
could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server 
(possibly due to the service shutting down). See server logs for more details.
At line:1 char:1
+ Connect-MsolService –Credential $LiveCred -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Connect-MsolService], CommunicationException
    + FullyQualifiedErrorId : System.ServiceModel.CommunicationException,Microsoft.Online.Administration.Automation.ConnectMsolService

Connect-MsolService : Exception of type 'Microsoft.Online.Administration.Automation.MicrosoftOnlineException' was thrown.
At line:1 char:1
+ Connect-MsolService –Credential $LiveCred -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Connect-MsolService], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.MicrosoftOnlineException,Microsoft.Online.Administration.Automation.ConnectMsolService

0 个答案:

没有答案