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
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
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
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!
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!
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.- Edited by pankajadlakha 9 hours 8 minutes ago