Forum Discussion

chenrylee's avatar
chenrylee
Copper Contributor
May 21, 2019

[Hybrid Exchange] Connect Create PowerShell Session to Exchange Online

I'm working with Windows 10, and want to connect to Exchange Online, but facing some errors.

It's my code:

$adm_credential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office.de/powershell-liveid/ -Credential $adm_credential -Authentication Basic -AllowRedirection
And I got this error:
New-PSSession : [outlook.office.de] Connecting to remote server outlook.office.de failed with the following error
message :
[ClientAccessServer=FRXPR01CA0067,BackEndServer=,RequestId=c4cbbb6f-9bc6-4b14-8d86-e15333e12777,TimeStamp=5/21/2019
6:54:32 AM] [FailureCategory=Cafe-HttpProxyException] Failed to resolve tenant name from SMTP address
'username@mydomain.com'. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : -2144108477,PSSessionOpenFailed
I checked all prerequisites, and didn't find any exception.
PowerShell sessions could be established to on-premise AD, on-premise Exchange, AzureAD, msolService, and so on.
I googled the error, and tried every solution I could get.
 
How can I establish the connection? Thank you in advance.
 

3 Replies

Resources