RDS CALS and TSCTST.exe tool
Guys, this wonderfully handy tool was able to decode the MSLicensing key (and hence the RDS/TC Cal) info on Windows XP but no longer works in Windows 7. Is there an equivalent tool for Windows 7/2008 R2 ?
February 27th, 2014 5:56pm

Hi,

Unfortunately there is no updated version of tsctst.exe or equivalent.  You may be able to get it to work if you copy the contents of MSLicensing to Wow6432Node\Microsoft\MSLicensing, however, I have not tried it.

-TP

  • Marked as answer by shocko Sunday, March 02, 2014 4:22 PM
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 1:55am

Yes, it works if you copy the key but that is a little cumbersome unfortunately. I'm looking into writing  something for this using c#
March 2nd, 2014 4:22pm

Hi,

The code below should get you started.  For this sample to work you need to set the Platform target to x64 in project properties.

 
using Microsoft.Win32;
using System.IO;
using System.Diagnostics;

namespace ExtractMSLicensingToFile
{
    class Program
    {
        static void Main(string[] args)
        {
            string fileName = "c:\\temp\\license000.p7b";
            RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MSLicensing\\Store\\LICENSE000");
            object value = key.GetValue("ClientLicense");
            byte[] bytes = (byte[])value;
            File.WriteAllBytes(fileName, bytes);
            Process.Start(fileName);
        }
    }
}
 

Please note the above sample has no error handling, does not account for multiple license (LICENSExxx) stores which may be present, etc., and was only tested on Windows 8 x64. 

Please take a look inside of the generated .p7b file.  By examining the license (certificate) issued to the client device you can see valid from/to dates, server that issued the license, license server product id, issued to user name, scope, license id, and more.

Thanks.

-TP

  • Proposed as answer by TP []MVP, Moderator Tuesday, March 04, 2014 5:20 AM
  • Marked as answer by shocko Tuesday, March 04, 2014 2:38 PM
Free Windows Admin Tool Kit Click here and download it now
March 4th, 2014 5:17am

Thanks, I'll build something off that ;)
March 4th, 2014 2:39pm

Hi,

If somebody is interested in powershell it Looks like this:

$a = gp "hklm:\SOFTWARE\Microsoft\MSLicensing\Store\LICENSE000" "ClientLicense"
$a."ClientLicense" | set-content c:\temp\Mylicense.p7b -enc byte

Regards

  • Marked as answer by shocko Thursday, September 25, 2014 4:52 PM
Free Windows Admin Tool Kit Click here and download it now
September 25th, 2014 2:32pm

Hi TP,

In your reply you mention that "Please note the above sample has no error handling, does not account for multiple license (LICENSExxx) stores which may be present, etc". As I understand from your statement, there can be scenarios in which the client device's license store in the registry may have more than one license. Can you please tell me which are those scenarios? I have done some experiments with remote desktop sessions and have not seen multiple Per Device CALs being issued to the same client device. Thanks a lot!


March 4th, 2015 2:05am

I do understand that this is a completely different question, I can ask this as a new question too, if that would be better.

Thanks!

Free Windows Admin Tool Kit Click here and download it now
March 4th, 2015 2:49am

Well for example, I'm using my laptop to type this message. I use a VPN connection into 4 different companies and launch mstsc client locally once VPN is established. As such, i get an RDSCAL form each of their licensing servers ;)
March 4th, 2015 9:05am

Thanks a lot for your reply Shocko. It does make sense. I want to replicate this in my workplace environment. I have done some experiments with RDP to understand how the license storage works. One of the cases is:

1. The setup is that there are 2008 RDS host and 2008 License Server machines in one network (this is basically the regular wireless network at my workplace and anybody can connect to it, no VPN required). Then we have  2008 RDS host and license server machines in the my company's corporate network (this requires VPN access).

2. The client machine is on the wireless network.

3. Now, first connect the client device to the 2008 RDS host (which is on the wireless network), connect two times so that it gets a permanent license and you can see the license count decrement on the corresponding 2008 license server.

4. Now, connect the same client to the VPN, and then start a session with the 2008 RDS host (in the corp network), it would not be allocated a new 2008 license and you can see license count remaining same in the 2008 license server.

5. At this time the count is decremented on the first server only.

So, in my setup the client device gets only one license. Is this because one session is happening through VPN and the other one not. 

In your case, you are having sessions with completely different companies, the license servers in each of these companies can't talk to each other. In my case too the license servers can't talk to each other as they are on two different networks.

I just want to understand that how can I replicate what you have in my environment.

Thanks a lot for your help.
Free Windows Admin Tool Kit Click here and download it now
March 6th, 2015 5:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics