Summary: When Public API is enabled you may get the errors below when attempting to connect to Cayosoft Administrator Service via CGraph module. These errors have different root causes. This article contains instructions on how to resolve these errors.
Applies to: Cayosoft Administrator 7.3.0 or later
ID: KB20210210-1
Resolution
Connection issues
Errors:
Connect-CGraphAdminService : Unable to connect to the remote server
Connect-CGraphAdminService : No connection could be made because the target machine actively refused it 192.168.130.100:7801
Connect-CGraphAdminService : An error occurred while sending the request. Connect-CGraphAdminService : The underlying connection was closed: an unexpected error occurred on a send.
Possible root cause:
Public API is disabled in Cayosoft Administrator, CGraph module is not installed, Firewall issue or wrong certificate.
Steps to resolve:
- In Admin Console navigate to Home > Configuration > Settings > Public API and ensure that Public API is enabled on this Administration Service is checked.
- If you connect from the machine where Administration Service is not installed check that this machine belongs to the same domain where Administration Service is installed.
- Check that CGraph module is installed:
- Run this PowerShell command: get-installedmodule
- CGraph Module and its version should be displayed in the list.
- CGraph connection requires these ports to be accessible: 7801, 7802, 7803. Please check that Firewall doesn't block this connection. You may need to create an Inbound rule for these ports.
- Check that there is a proper certificate that Public API can use. By default, Public API utilizes any certificate from "cert:\localmachine\my" which subject matches host FQDN. When you enable Public API, Cayosoft Administrator enumerates available certificates and if there is no suitable certificate creates a self-signed certificate and uses it.
Errors:
Connect-CGraphAdminService : unknown_error: OAuth authorize request returns unexpected result. HttpStatus: 'RequestUriTooLong'
Possible root cause:
This issue may occur if the user is a member of many Active Directory user groups. More details you can see here or here.
Steps to resolve:
- Workaround 1: Increase the settings for the
MaxFieldLength
registry entry on the server so that the user's request headers don't exceed these values.
1. Open Registry Editor and navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters
2. Set value for parameter MaxFieldLength = 65534 (decimal). If parameter is absent you need to add new DWORD value.
3. Restart the host.
More details here: https://docs.microsoft.com/en-US/troubleshoot/iis/httpsys-registry-windows - Workaround 2: Use -credential parameter to specify credentials when connecting to Cayosoft Administrator:
$cred = Get-Credential
Connect-CGraphAdminService -Credential $cred
Comments
0 comments
Please sign in to leave a comment.