Error to connect EXO with PS

New Contributor

Hi,

Could anybody please help me. Why this message is showing while trying to connect EXO using PS? 

 

PS C:\Users> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following
error message : 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

3 Replies

@MAYousuf 

 

Are you running it as a script from ISE, or just from powershell ?

 

Have you tried running another script to see if that fails ?

 

Here's one, if you don't have any

https://gallery.technet.microsoft.com/Office-365-and-Azure-e36eabeb

Hi,

Are you aware that Microsoft has a new  Exchange Module for powershell
ExchangeOnlineManagement.
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps
You don't have to use the $session command line


It has new commands which are improving  the performance.
You probably have to update your script.

Maybe this helps.

Thanks a lot. I have fixed the problem which was with my credential id. I had used another id to access there.