When you use PowerShell to connect to Exchange Online you may encounter an Access is Denied error message:
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. At line:2 char:12 + $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed Import-PSSession : Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument, and then try running the command again. At line:3 char:18 + Import-PSSession $Session -DisableNameChecking + ~~~~~~~~ + CategoryInfo : InvalidData: (:) [Import-PSSession], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.ImportPSSessionCommand
This error message is usually caused by one of the following three issues:
- You entered an invalid user name or password
- You do not have the proper permissions/roles
- You are using the old EXO module
The first and second issues are easily fixed by checking your credentials and role assignment in Office 365.
The solution to the third issue is to use the EXO V2 module to connect to Exchange Online.
Install EXO V2 using the following command:
Once the EXO V2 module is installed you can connect to Exchange Online with MFA using the following command:
How to Manage Exchange Online Mailboxes From Active Directory
Easy365Manager is a snap-in to Active Directory Users & Computers that allows you to manage Office 365 licenses and mailboxes directly from AD user properties.
With Easy365Manager you no longer need to use PowerShell or the multiple Office 365 web consoles to manage Office 365.
The Easy365Manager snap-in gives you access to Office 365 license and mailbox management directly from AD Users & Computers:
With these new tabs you can perform Office 365 mailbox management without leaving AD Users & Computers.
You can even perform tasks that are normally only available via PowerShell, e.g., like configuring calendar permissions: