I am trying to connect O365 exchange / Exchange Online from powershell, I am using this link as guide.
however after running this powershell command
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
I am getting below error
This is error message
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : [ClientAccessServer=SG2PR01CA0093,BackEndServer=,RequestId=2498a60b-034b-40d1-9e57-3e04fdae8d5f,TimeStamp=4/16/2019 9:48:00 AM] [FailureCategory=Cafe-HttpProxyException] Failed to resolve tenant name from SMTP address '[email protected]'. 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