Troubleshooting Terminal Server Licensing Issues (Part 3)

Some of the more less-common issues with Terminal Server licensing, including: corrupt license databases, activation issues, and problems adding CALs.

If you would like to be notified when Michael Burle releases the next article in this series please sign up to the MSTerminalServices.org Real time article update newsletter.

If you would like to read the previous articles in this series please go to:

In parts one and two of this four-part series, we discussed the more common server-related licensing issues. In this segment, I’ll cover some of the more less-common issues with terminal server licensing, including:

  • Corrupt license databases
  • Activation issues
  • Problems adding CALs

Corrupt Licensing Database

Although rare, it is possible for the licensing database to become corrupt. Symptoms of a corrupt database include not being able to start the licensing service, failure of the service to stay running, or possibly the inability of terminal servers to lease CALs (although this last one is most likely due to some other underlying issue).

Corruption can occur for a number of reasons, but the most popular is making the mistake of placing the licensing database on a compressed drive. The drive compression could cause a write-delay, thereby corrupting the database. Per Microsoft, Jet-based databases should not be located on compressed drives. See Microsoft KB Q318116 for more information.

Other ways corruption can occur is incorrect shutdown of the server or a licensing service crash, or a hardware related issue such as a problematic RAID controller or faulty cache.

Of course, there is no better protection against corruption than a good backup; however if you find yourself with a corrupt database you can recreate a new (empty) database pretty easily. Keep in mind that the new database will not have any of your CALs installed; you will need to contact the Microsoft Clearinghouse to recover them.

Recreating the database is as simple as removing or renaming the existing database folder and restarting the service:

  1. Stop the Terminal Server Licensing service.
  2. Rename the LServer directory in Windows\System32 (default location) to something such as LServer_Old.
  3. Create a new folder where the old one was (\Windows\System32 by default) called LServer.
  4. Start the Terminal Server Licensing service.

When the service is started, it will automatically create a new TLSLic.edb database file along with a set of transaction logs. You can verify success by checking the LServer directory for the existence of the database file, and the event log should list the following events:

Event ID

Source

Description

5

TermServLicensing

Policy Module %SystemRoot%\system32\tls236.dll for company Microsoft Corporation has been loaded.

0

TermServLicensing

Terminal Services Licensing was started.

The LServer directory should contain the following files when the service is started:

File Name

Description

edb.log

License database transaction log

edb.chk

Checkpoint file used by Jet to identify where in the transaction log that transactions have been committed to the database

res1.log

Reserve log file in case the disk runs out of space.  Limited to 5MB

res2.log

Second reserve log with the same purpose of res1.log

TLSLic.edb

The actual licensing database file

temp.edb

Used to store information about in-progress transactions

Once you have verified the database has been successfully recreated, you will need to contact the Microsoft Clearinghouse to have them reissue your CALs. To locate the phone number for the Clearinghouse, change the License server’s activation method to Phone in the Terminal Server Licensing program (right-click on the license server in the interface and select Properties). When you then go through the Install Licenses wizard, the phone number for your region will be displayed. You can also find all region phone numbers in the following registry location:

HKLM\Software\Microsoft\TermServLicensing\LrWiz\CSNumbers

If you received an error message when you restarted the Terminal Server Licensing service in step 4 above, make sure you created the LServer directory and it is in the correct location. The service looks to the following registry location to find the licensing database:

HKLM\System\CurrentControlSet\Services\TermServLicensing\Parameters\DBPath

The following event log entries may also be observed if the database could not be created:

Event ID

Source

Description

44

TermServLicensing

General database error occurred, Can't initialize ESE instance - error -1811 JET_errFileNotFound, File not found.

7024

Service Control Manager

The Terminal Services Licensing service terminated with service-specific error 31.

Activation Issues and Problems Installing CALs

If you are having problems activating the license server, there may be a few causes.

You could have an incomplete License Service installation or a set of corrupt/invalid certificates. Check the event logs for the following event:

Event ID

Source

Description

38

TermServLicensing

Can't generate a license for client because of error 'Can't add certificate to store, error c0010020.

You may also observe the following error:

Internal Error: 0xc0110011

If so, the easiest resolution is to remove the Terminal Server Licensing service from the server and reinstall it.

  1. If necessary, stop the Terminal Server Licensing service and rename the LServer directory (located in \Windows\System32 by default).
  2. In the Windows Components section of Add/Remove Programs, uncheck Terminal Server Licensing, and complete the wizard.
  3. After rebooting the server, return to the Windows Components section of Add/Remove Programs and check Terminal Server Licensing. Complete the wizard by selecting a location to hold the LServer directory (anywhere but a compressed drive; the default location of \Windows\System32 is fine).

Check that the service has started and that the LServer directory was created properly. You can also check the Windows event log for the following entries that indicate a successful start of the service:

Event ID

Source

Description

5

TermServLicensing

Policy Module %SystemRoot%\system32\tls236.dll for company Microsoft Corporation has been loaded.

0

TermServLicensing

Terminal Services Licensing was started.

Once that’s verified, use the Licensing Wizard from the Terminal Server Licensing program to reactivate the license server.

CAL Pack Installation Issues

If you are having troubles installing CAL packs, there are a few things to check. You may receive an error message similar to the following when you attempt to install the token pack:

Licensing Wizard was unable to install the client license key pack. Please verify your entry and try this operation again. Message Number 0x13A7.

The message number may also be either 0xFA1 or 0x13A4.  In any case, there are a few possible causes. First, if you are installing a license token pack on a Windows 2000 License Server, be sure the CALs are not intended for Windows Server 2003. You cannot install a Windows Server 2003 license pack on a Windows 2000 license server; you need to install a Windows Server 2003 license server in your enterprise to use Windows Server 2003 CAL packs.

Another possible cause is a problem with the TermServLicensing Policy key. Check the following registry key on the license server:

HKLM\Software\Microsoft\TermServLicensing\Policy\Microsoft Corporation\A02

There should be a string data type of DLL with a value of %systemroot%\System32\tls236.dll. If you notice that this value doesn’t match, then correct it. If the DLL string data is missing entirely, then create it and set the value to %systemroot%\System32\tls236.dll.

If all else fails, remove the license service from the server and reinstall it. This will correct any issues with the service installation or the certificates associated with the server.

If you are having issues with the Terminal Server Licensing program crashing, there is a known issue which has been corrected in Windows Server 2003 SP2. You will typically see this when you open Terminal Server Licensing, click on a per-user CAL pack and refresh the display. There’s a bug in the Licmgr.exe binary that causes an access violation. If you aren’t in a position to upgrade your terminal servers to SP2 to correct it, you can obtain a hotfix for SP1 installations by contacting Microsoft Product Support Services. See Microsoft KB 910088 for more information. Pre-SP1 installations didn’t typically exhibit this behavior.

Finally, sometimes trouble with activating a license server or installing CALs can be resolved simply by attempting to activate via phone. It’s not quite as convenient as activating over the Internet, but the process is straightforward and the Clearinghouse is usually very responsive (in other words, little or no hold times). The process for selecting Phone as your method of activation is detailed in the section “Corrupt Licensing Database” above.

Contact the Clearinghouse or PSS?

The question will ultimately arise as to which side of Microsoft should you contact for a specific problem – the Microsoft Clearinghouse or Product Support Services.

Contact the Microsoft Clearinghouse when your issue is one of the following:

  • Trouble activating the license server or adding CAL packs
  • You are reinstalling the license server, or recovering from a failed license server or corrupt database and need to recover lost CALs
  • You believe you have the incorrect CAL types (i.e. Per-Device CALs instead of Per-User CALs); the Clearinghouse can assist you with swapping out CALs for the correct type, provided that have not yet been activated

Basically, if the trouble is something administrative pertaining to the Terminal Server Licensing program, the Clearinghouse can help you.

If you are having technical difficulties with any of the following, contact Microsoft Product Supports Services (PSS):

  • Troubles discovering license servers
  • Issues with CALs not being allocated to clients correctly
  • License service crashes or won’t stay running

Generally, any technical issues after the license service has been successfully activated and CAL packs are installed will need to be referred to Microsoft PSS, including obtaining any hotfixes mentioned in this article series.

Final Thoughts

I covered several “not-so-common” issues with licensing in this segment. Be sure to check out parts one and two for more common issues that you will likely encounter. In the final segment of this four-part series, we’ll look at some of the common client-related issues with licensing.

If you would like to be notified when Michael Burle releases the next article in this series please sign up to the MSTerminalServices.org Real time article update newsletter.

If you would like to read the previous articles in this series please go to:

About Michael Burke

Mike is a virtual infrastructure engineer based in New Jersey and has been working with Citrix and Terminal Server products for 10 years. He currently works for a New England-based consulting firm where he also focuses on designing and implementing virtual infrastructure solutions based on products and technologies from VMware, Microsoft, Softricity and various others. He has written several technical articles and whitepapers, and has spoken at several forums and conferences around the United States.

Receive all the latest articles by email!

Get all articles delivered directly to your mailbox as and when they are released on VirtualizationAdmin.com! Choose between receiving instant updates with the Real-Time Article Update, or a monthly summary with the Monthly Article Update. Sign up to the VirtualizationAdmin.com Monthly Newsletter, written by VCP David Davis, containing news, tips, links of the month and much more. Subscribe today and don't miss a thing!



Receive all the latest articles by email!

Receive Real-Time & Monthly VirtualizationAdmin.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a VirtualizationAdmin.com member!

Discuss all your Virtualization issues with other experts. Click here to join!

Readers' Choice

Which is your preferred Backup and Recovery solution?

Follow TechGenix on Twitter