I would like to connect to outlook office 365 by using PowerShell.
Following below steps performed -
1)
PS C:\Windows\system32> $UserCredential = Get-Credential
2)
PS C:\Users> $s = New-PSSession -URI https://outlook.office365.com/PowerShell -Credential $UserCredential -AllowRedirection
Result / Output get error -
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : [ClientAccessServer=MA1PR0101CA0048,BackEndServer=,RequestId=6d22e2da-f0c9-4880-9936-1a3c12c1097b,TimeStamp=9/23/2019 2:01:34 PM] Access Denied For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:6 + $s = New-PSSession -URI https://outlook.office365.com/PowerShell -Cre ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportExcep tion + FullyQualifiedErrorId : -2144108477,PSSessionOpenFailed