Troubleshooting connection to Microsoft 365
Summary
During installation and initial configuration, Cayosoft Administrator performs various pre- installation checks to ensure all required components are installed and system settings are configured properly. However, there is the possibility that some settings may have been updated after the Cayosoft Administrator installation, or some settings were not properly verified during installation. This article provides an extensive set of verification procedures to ensure the system where Cayosoft Administrator Service is installed and configured properly.
Microsoft 365 connection account password issues
| Issue | Requirements |
|---|---|
| Error: Authentication Error: Password has expired. You must call the Connect-MsolService cmdlet before calling any other cmdlets. |
|
Incorrect configuration for the Office 365 connection account: account password is expired or the account must change the password on the first sign in. Please sign in to Office 365 with that account credentials, resolve any issues and restart the Administration Service. | |
| Error: Authentication Error: Unexpected authentication failure. |
Microsoft 365 connection account issues
| Issue | Requirements |
|---|---|
|
Incorrect configuration for the Office 365 connection account: multi-factor authentication (MFA) is enabled. Please disable MFA for the Office 365 Service Account and restart the Administration Service. Error: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. [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. |
|
| Error: AADSTS53003 Blocked by conditional access. |
|
| AADSTS50053: You've tried to sign in too many times with an incorrect User ID or password. |
|
Exchange Online connection issues
| Issue | Requirements |
|---|---|
|
[ps.outlook.com] Closing remote server shell instance failed with the following error message: Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. Cannot validate argument on parameter 'Session'. The argument is null. Supply a non-null argument and try the command again. [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message: The WinRM client cannot process the request. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again. For more information, see the about_Remote_Troubleshooting Help topic. Sessions to 'Microsoft Office 365' could not be established. Please read the platform returned error message(s) to identify the problem. The Check Settings Action, located on each extension's configuration page, may be useful for troubleshooting connection issues. Error Details: The term 'Get-SharingPolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. |
|
Sessions to 'Microsoft Office 365' could not be established. Please read the platform returned error message(s) to identify the problem. The Check Settings Action, located on each extension's configuration page, may be useful for troubleshooting connection issues. Error Details: Data returned by the remote Get-FormatData command is not in the expected format. |
For resolution, please see step-by-step instructions in the Appendix section. |
| The WS-Management service cannot process the request. This user has exceeded the maximum number of concurrent shells allowed for this plugin. Close at least one open shell or raise the plugin quota for this user. |
|
| Create Powershell Session is failed using OAuth. |
|
Microsoft Teams module connection issues
| Issue | Requirements |
|---|---|
| Required components are missing for Microsoft 365 extension: Microsoft Teams PowerShell Module. Details can be found here: https://support.cayosoft.com/hc/en-us/articles/360055917372 | Microsoft Teams module shoud be installed. Please see step-by-st instructions. |
| The operation couldn't be performed because object 'GUID' couldn't be found on 'DB5PR05A008DC05.EURPR05A008.PROD.OUTLOOK.COM'. | The error may occur because the settings are applied not only to the team itself but also to the created Office 365 group and this group may not be created yet. To avoid this error increase the Cloud back-end services replication delay setting in New Team Web Action. For resolution, please see step-by-step instructions. |
Sharepoint Online connection issues
| Issue | Requirements |
|---|---|
|
|
|
Add a registry subkey to the client computer |
|
Microsoft 365 connection issues
| Issue | Requirements |
|---|---|
Error: Relative URIs are not supported in the creation of the remote sessions. |
|
Verify Microsoft 365 connection account
Login to Office Portal with the Microsoft 365 connection account
Requirements:
Credentials provided for Microsoft 365 connection account must be valid to log on to Microsoft Admin Portal. If there is a prompt to complete a password reset it must be completed.
How to check:
Open Microsoft 365 Admin Panel and reset the password for Microsoft 365 connection account. Make sure to clear the checkbox Make this user change their password when they first sign in:
Log on to https://portal.office.com with the new password for Microsoft 365 connection account, to make sure these credentials would be valid.
Open the Cayosoft Administrator Console.
Click [...] button next to the account.
Specify a new password for Microsoft 365 connection account.
Restart the Cayosoft Administrator Service to make sure all sessions are fully re-established:
How to check if the account password is set to never expire
You can check and set the account password to never expire if it is not set to it. Microsoft 365 native Admin Center does not provide a user interface for this, so you have 2 options:
Using PowerShell, as described for examples here: Set an individual user's password to never expire - Microsoft.
-
Using CayosoftWeb Portal, after you reset the password. After that, Cayosoft Administrator re-establishes the connection to Microsoft 365:
Open the Web Portal.
Navigate to Microsoft 365 > Users.
Search for the connection account used to connect to Microsoft 365.
Click the Reset Password action.
Check the Password never expires option.
Check Microsoft 365 settings in the Cayosoft Administrator Console
Requirements:
The Microsoft 365 extension must be enabled.
The valid Microsoft 365 credentials must be provided as a Microsoft 365 connection account. Check Settings and the Run Components Check and resolve any reported errors.
How to check:
In Cayosoft Administrator console, navigate to Microsoft 365 extension settings.
Check the Microsoft 365 credentials are not empty - this is the account being used to connect to Microsoft 365. There are several steps listed below to verify this account is configured properly.
-
Click the Check Settings command from the menu in the right pane and confirm it completes without an error.
NOTE: This command validates the specified settings and verifies that:
The account credentials are correct.
Connection account role membership.
-
Connection to Exchange Online.
If the Check Settings command completes successfully but you still get the error in Web Portal you should troubleshoot the Exchange Online connection. Please see the step-by- step instructions in sections 1.5 and 1.6.
Run the Run Components Check and confirm all required components are installed.
Check if Microsoft 365 connection account is a cloud- only account
Requirements:
The Microsoft 365 connection account must be a cloud-only account, i.e. an account that is not synchronized with Azure AD Connect.
How to resolve:
Navigate to https://login.microsoftonline.com.
Open Microsoft 365 Admin Center, then open the list of Active users.
Locate the Microsoft 365 connection account in the list. Make sure the Sync Type column states In cloud for the account.
Validate Microsoft 365 connection account for MFA enforcement
Requirements:
The Microsoft 365 connection account must be excluded from MFA enforcement.
How to resolve:
Cayosoft Administrator can automatically validate the Microsoft 365 connection account and check that the Microsoft 365 connection account is enrolled to MFA. However, some additional configuration steps are required:
In Cayosoft Administrator Console, navigate to Home > Configuration > Connected Systems Extensions > Microsoft 365.
Click the [...] button next to Microsoft 365 credentials.
On the Specify Credentials window, click Validate to check that Microsoft 365 connection account is enrolled to MFA.
Perform the steps described in these articles:
Verify the Global Administrator role for the Microsoft 365 connection account
Requirements:
The Microsoft 365 connection account must be assigned the Global administrator role in Microsoft 365 (Azure AD). For more details, please see the Permissions required for AD and Microsoft 365 accounts used by Cayosoft Administrator article.
How to check:
In the Microsoft 365 Admin Portal, select the account you intend to use as the connection account for Cayosoft Administrator.
Open the Roles dialog for the selected account.
-
Make sure the Global administrator role is assigned, as shown in the screenshot below.
Review the following Microsoft article: (Access is denied) error when you connect to Exchange Online by using remote Windows Power Shell for details on ensuring the administrative account has Microsoft 365 Administrative Credentials.
Verify Exchange Online roles for the Microsoft 365 connection account
Requirements:
The Microsoft 365 connection account must be a member of the Organization Management role in Exchange Online.
How to check:
In the Microsoft 365 Admin Portal, expand the Admin centers navigation group and select Exchange to go to Exchange Admin Center.
Select Roles > Admin roles menu item.
Find the Organization Management role group and click the Assigned tab.
Make sure the Microsoft 365 connection account is present in the list. If the connection account is a member of the Global Administrators Azure role, the presence of the group Company Administrator in the list is sufficient.
Verify Organization Management role group in Exchange Online has all default roles enabled
Requirements:
Ensure that the Organization Management role group in Exchange Online has all default roles enabled. If you disable some default roles, the Cayosoft Administrator connection account can lose assets to required functions and you'll get errors that some PowerShell commands are not found.
How to check:
In the Microsoft 365 Admin Portal, expand the Admin Centers navigation group and select Exchange to go to Exchange Admin Center.
Select Roles > Admin roles menu item.
Find the Organization Management role group and click the Permissions tab.
Make sure that you have all the permissions from the list in this article for the Organization Management role group selected.
Verify Access Control policies are enforced in SharePoint online
How to check:
-
Sign in to the Access control page of the SharePoint admin center.
Check Unmanaged devices and Apps that don't use modern authentication policies:
If the Unmanaged devices policy is set to anything other than Allow full access, you need to make the computer running Cayosoft Administrator a managed device, i.e. you need to join it to Azure AD.
If the Apps that don't use modern authentication is set to Block access, you need to check that Modern authentication is enabled in Microsoft Microsoft 365 extension in the Cayosoft Administrator console.
If the error still persists add the registry subkey on the client computer to force modern authentication that will resolve the errors with connection to SharePoint Online. For details please see this article Troubleshooting connection to SharePoint Online.
Verify required software components and system settings
Verify required software components
Requirements:
The Exchange Online PowerShell module is required to connect to and manage Microsoft Entra ID, Microsoft 365, and Exchange Online.
How to check:
On the server where the Cayosoft Administrator Service is deployed, run the Cayosoft Requirements Check tool.
Verify the Exchange Online PowerShell Module (EXO V3) is marked as <Installed>.
Test connection.
Verify PowerShell remoting is enabled
Requirements:
The PowerShell Remoting must be enabled.
How to check:
Click Start (or press the Windows flag key). The windows start menu or start screen appears.
Run the PowerShell ISE as administrator.
-
Run the following script:
CopyEnter-PSSession –computername localhost No warnings or messages should appear, only the command prompt should be visible, as shown in the screenshot below.
How to resolve:
If a warning message appears you will need to enable PowerShell Remoting: Enable-psremoting.
Verify PowerShell Execution Policy is Unrestricted or RemoteSigned
Requirements:
The PowerShell Execution Policy must be set to Unrestricted or RemoteSigned.
How to check:
Run PowerShell ISE as administrator.
-
In the PowerShell ISE Window run the following script:
get-ExecutionPolicy
The following values must be returned:
Unrestricted
or
RemoteSigned
How to resolve:
If the system does not return Unrestricted or RemoteSigned then use the following command to set the policy:
set-executionpolicy remotesignedVerify Windows Remoting (WINRM) is Enabled
Requirements:
The Windows Remoting service must be started.
How to check:
Run the PowerShell ISE as administrator.
-
Run the following script:
CopyGet-service winrm You should see the message displayed below:
How to resolve
If the system indicates WINRM is not running then run the following command to start the service:
net start winrmVerify Basic Authentication is Enabled for Windows Remoting (WINRM)
Requirements:
For versions 9.x and earlier, Basic Authentication must be enabled for Windows Remoting on the machine running Cayosoft Administrator. This is a Microsoft requirement for Exchange online: About the Exchange Online PowerShell V2 module and V3 module | Microsoft Learn
Cayosoft Administrator uses the newer EXO module and REST- based commands that do not require Basic authentication in WinRM.
How to check:
Run the PowerShell ISE as administrator.
-
Run the following script:
Copywinrm get winrm/config/client/auth Check if the
Basicparameter is set to true.
How to resolve:
If
Basic = falseis displayed, then run the following command to enable Basic Authentication:
winrm set winrm/config/client/auth '@{Basic="true"}'-
If
Basic = false [Source = "GPO"]is displayed you should find the Group Policy and disable it then setBasic = true:-
Get all available information about Group Policy. It includes detailed settings that were applied with a precedence of 1 and higher:
Copygpresult /z When you found the Group Policy, disable it.
-
Update group policy:
Copygpupdate /force Run the following script to enable Basic Authentication:
Copywinrm set winrm/config/client/auth '@{Basic="true"}' -
Restart the CCayosoft Administrator Service.
Test connection to Azure Cloud Services outside of Cayosoft Administrator
To eliminate the possibility that Firewall, Proxy, PowerShell, or other environmental problems are preventing the Cayosoft Administrator to connect to Azure Cloud Services, use PowerShell ISE Window as Administrator to run the scripts below.
For each Azure service, use Microsoft 365 connection account that is specified in the Cayosoft Administrator Console > Home > Configuration > Connected Systems Extensions > Microsoft 365.
Exchange Online
Stop the Cayosoft Administrator Service before connecting to Exchange Online to avoid the host processes limit.
Stop-Service CayoAdminService [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 -bo Connect-ExchangeOnlineMicrosoft Teams
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 -bo Connect-MicrosoftTeamsSharePoint Online
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 -bo
$credential = Get-Credential
Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential $credentCayosoft Graph
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 -bo Connect-CGraphAdminService -Server '<Server name>'Next Steps
If the connection was successful, but you still experience problems, please contact Cayosoft Support for additional assistance.
If the connection failed please verify that Antivirus, Firewall or Proxy Settings are not preventing this computer from connecting to Microsoft 365.
Check Cayosoft Administrator Configuration
Verify Microsoft 365 API URL is specified
How to check:
In the Cayosoft Administrator Console, navigate to Home > Configuration > Connected Systems Extensions > Microsoft 365.
Open the Advanced Settings section.
Check that Microsoft 365 API URL (Advanced) setting has https://outlook.office365.com/powershell-liveid/ value.
How to resolve:
If the value is empty, copy/paste this value and save the changes.
The maximum number of Exchange Online connections exceeded
NOTE: Each Cayosoft Server should have its own set of service accounts for all managed platforms: Active Directory, Microsoft 365, Exchange Server on-premise, etc.
If you need to run some diagnostic script, stop the Cayosoft Administrator Service to avoid maximum connections exceed.
You might get the error due to the limitation of the number of sessions to Exchange Online. A maximum of three simultaneous remote PowerShell connections to Exchange Online Organization is allowed. You need to wait for 30 minutes, after that the sessions that are not used would be closed and the error won't be displayed.
Appendix
Error: Data returned by the remote Get- FormatData command is not in the expected format
This is a known issue related to Exchange Online sessions introduced by Microsoft. It appears only on some Microsoft 365 tenants. Cayosoft Administrator re-creates Exchange Online sessions on start and then after they are expired.
Due to this problem, new Exchange sessions can not be recreated. For more details, please read this post: Cannot connect to exchange online via powershel.
According to the post, this issue might go after some time. But in the 7.3.0 version, the new Apply fix for Get-FormatData error setting was added in the Advanced Settings section in Microsoft 365 extension:
In the Cayosoft Administrator Console, navigate to Home > Configuration > Connected Systems Extensions > Microsoft 365.
Expand the Advanced Settings section.
Set Apply fix for Get-FormatData error to Try 2nd workaround.
Click Save Changes.
Restart the Cayosoft Administrator Service.
If the issue still is not resolved, select Try 1st workaround in step 3.
Comments
0 comments
Article is closed for comments.