Documentation forServer & Application Monitor
Monitoring your applications and environment is a key capability of SolarWinds Observability Self-Hosted (formerly Hybrid Cloud Observability) and is available in the Essentials edition. Server & Application Monitor (SAM) is also available in a standalone module.

Terminal Licensing Server

This SAM application monitor template assesses the status and overall performance of a Microsoft Terminal Services (TS) Licensing Server by collecting data from the Windows System Event Log, Windows Service, and PowerShell monitors.

Prerequisites

  • WMI access to the target server
  • Windows Server 2003 Resource Kit Tools is installed on the Terminal Licensing Server
  • WinRM is configured on the target server.

Credentials

Windows Administrator on the target server.

Component monitors

All Windows Event Log monitors should return zero values. Returned values other than zero indicate an abnormality. Examine the Windows System log file, with “TermServLicensing” and “TerminalServices-Licensing” source names, to learn more about an the issue.

Licenses Usage

This monitor returns license usage statistics by running the lsreport tool from the Windows Server 2003 Resource Kit Tools. In the message fields, this component indicates which machine connection is initialized (Client), which user currently uses a license (User), the License Type, and when the connection ends. Returned values are as follows:

  • Temporary: Returns the number of currently used Temporary licenses. Temporary licenses are provided when a client connects for the first time.
  • Active: Returns the number of currently used Active licenses. After the second connection with a successful login, the client gets an Active license.
  • Upgraded: Returns the number of currently used Upgraded licenses. Windows 2000 licenses that were upgraded to a Windows 2003 license is called Upgraded.
  • Total Used: Returns the total number of currently used licenses. It uses the following argument:
    path_to_lsreport, target_server

    where
    • path_to_lsreport: The full path to the lsreport.exe file. If Resource Kit Tools are installed in the default location, this argument should be as follows:

      For x86 Windows: C:\Program Files\Windows Resource Kits\Tools\lsreport.exe;

      For x64 Windows: C:\Program Files (x86)\Windows Resource Kits\Tools\lsreport.exe
    • target_server: The IP address of the target server. It should be: ${IP}.

    Argument example:
    C:\Program Files\Windows Resource Kits\Tools\lsreport.exe, ${IP}

Service: Remote Desktop Licensing

This monitor returns the CPU and memory usage of the Remote Desktop Licensing server (Terminal Licensing Server on 2003). This service provides registered licenses for Remote Desktop Services clients. If this service is stopped, the server cannot issue Remote Desktop Services licenses to clients when they are requested.

Events: Startup Errors

This monitor returns the number of events that occur when:

  • There is a Work Manager or Cannot Startup Work Scheduler error;
  • The TS Licensing service could not create the service initialization thread;
  • The TS Licensing service could not start due to a lack of system resources;
  • The TS Licensing service cannot start due to an error;
  • An error occurred during the TS license server initialization phase;
  • The RPC port is not listening;
  • TS Licensing is unable to allocate the required system memory to perform the operation;
  • Cannot initialize policy module because of an error;
  • A security descriptor cannot be set. As a result, terminal servers might not be able to connect to TS license servers.

Type of event: Error and Warning. Event ID: 43, 30, 36, 37, 4097, 4104, 4117, 41, 4142.

For Work Manager or Cannot Startup Work Scheduler errors, see Windows documentation (© 2021 Microsoft Corp., available at docs.microsoft.com, obtained on November 4, 2021).

Terminal Services Licensing service: If the service initialization thread cannot be created, or a lack of system resources events exist, increase the amount of available memory on the TS license server.

If this service cannot start due to an error event, ensure that the required groups are granted the correct permissions to the TermServLicensing registry key. The value of the DBPath registry key should match the location of the LServer directory. If the problem persists, restart the TS license server.

For an error that occurred during the Terminal Services License Server Initialization Phase event, start the Terminal Services Licensing service, and if necessary, remove and then reinstall TS Licensing.

For an RPC Port Is Not Listening event, verify that the TS license server is available and ensure that the Terminal Services Licensing service is running.

For the Cannot Initialize Policy Module events, ensure that the Terminal Services Licensing registry key contains the following correct settings:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TermServLicensing\Policy\MicrosoftCorporation\A02,.

The registry subkey contains the following entry: String Name: DLL; String Value: %systemroot%\System32\tls236.dll.

For Security Descriptor Cannot Be Set events, restart the Terminal Services Licensing service.

Events: License Errors

This monitor returns the number of events that occur when:

  • A license cannot be generated for a client because of an error;
  • TS Licensing on the server is activated. Licensing will only issue temporary licenses until the server is activated;
  • The server has no license pack or permanent license for the product;
  • A license could not be issued because it is not a member of the Terminal Server Computers group;
  • One or more TS Licensing certificates on the server are corrupt.

Type of event: Error and Warning. Event ID: 38, 18, 22, 21, 45, 17.

For Cannot Generate A License For Client Because Of Error events: Review this event in the Windows Event Monitor for details.

For the Terminal Services Licensing On Server Has Not Been Activated events: Activate your TS Licensing server.

For the Terminal Services Licensing Server Has No License Pack Registered Product events: Use TS Licensing administrative tool to register the license pack.

For the Terminal Server Licensing Server Has No Permanent Licenses For Product events: Use the Terminal Server Licensing administrative tool to register more licenses.

For A License Could Not Be Issued To Because It Is Not A Member Of The Terminal Server Computers Group events: check the status of the License Server Security Group.

If the status is set to Enabled, a local group called Terminal Services Computers is created. The Terminal Server License Server grants licenses only to computers whose computer accounts are placed in this group. When the target computer is a domain controller, this group is a domain local group.

If the status is set to Disabled, the Terminal Server License Server issues a license to any computer that requests one. The Terminal Services Computers group is not deleted or changed in any way. This is the default behavior.

If the status is set to Not Configured, the Terminal Server License Server acts the same as if the status is set to Disabled. If you did not add any clients to this group, any machine attempting to connect to the terminal server would be denied.

For one or more Terminal Services Licensing certificates on server are corrupt events: Reactivate the TS Licensing server or the RD Licensing server.

Events: Database Errors

This monitor returns the number of events that occur when:

  • Cannot connect to the database;
  • General database error occurred.

Type of event: Error and Warning. Event ID: 7, 44.

Events: Service Stopped

This monitor returns the number of events that occur when:

  • The Terminal Services Licensing service stopped;
  • TS Licensing experienced a general initialization failure.

Type of event: Error and Warning. Event ID: 3, 4115.

For these events, start the Terminal Services Licensing service, and if necessary, remove and then reinstall TS Licensing.

Events: Connection Errors with SCM

This monitor returns the number of events that occur when:

  • The Terminal Services Licensing service cannot connect to the Service Control Manager;
  • The Terminal Services Licensing service cannot report status to the Service Control Manager.

Type of event: Error and Warning. Event ID: 27, 28.

Restart the Terminal Services Licensing service. If necessary, restart the server.