Article ID: 2905767 - View products that this article applies to.
When you try to connect to Microsoft Exchange Online by using remote Windows PowerShell, you receive the following error message:
[outlook.office365.com] Connecting to remote server failed with the following error message: Access is
denied. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) .
+ FullyQualifiedErrorId : PSSessionOpenedFailed
Import-PSSession : Cannot validate argument on parameter 'Session'. The argument is null.
Supply a non-null argument and try the command again.
At D:\Users\Connect.ps1:7 char:21
+ Import-PSSession < < < < $Session
+ CategoryInfo : Invalid Data: (:) [Import-PSSession], ParameterBindingValidationException
+ FullyQualifiedErrorId :
This issue occurs for one of the following reasons:
By default, only global admins can connect to Exchange Online by using Windows PowerShell. Other admins must be delegated access in the Exchange admin center to connect to Exchange Online through Windows PowerShell.
To resolve this issue, use the Exchange admin center in Office 365 to add the user as a member of the administrator role group. To do this, follow these steps:
For more information about how to connect to Exchange Online by using remote PowerShell, go to Connect to Exchange Online using Remote PowerShell
Still need help? Go to the Office 365 Community