This is also something new... Code: using System; using System.Management; using System.Windows.Forms; namespace WMISample { public class CallWMIMethod { public static void Main() { try { ManagementObject classInstance = new ManagementObject("root\\CIMV2", "SoftwareLicensingService.Version='10.0.10586.0'", null); // Obtain in-parameters for the method ManagementBaseObject inParams = classInstance.GetMethodParameters("AcquireGenuineTicket"); // Add the input parameters. inParams["ServerUrl"] = "The activation server URL"; inParams["TemplateId"] = "Most likely the GT code goes here"; // Execute the method and obtain the return values. ManagementBaseObject outParams = classInstance.InvokeMethod("AcquireGenuineTicket", inParams, null); // List outParams Console.WriteLine("Out parameters:"); Console.WriteLine("ReturnValue: " + outParams["ReturnValue"]); } catch(ManagementException err) { MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message); } } } }
Do you have any reason to suspect that your PC has any information as to where the Digital Entitlement came from? My PCs upgraded from 8.1 KMS initially reported having a MAK license but on a reinstall it now lists it as Retail.
Does the Enterprise version not eligible for Digital Entitlement? I upgraded Ent 10240 MAK activated to 10586 using ISO and it does not retain its activation.
Actually no, it's there since Win7 (at least) and was DEPRECATED since Win8 (open %WinDir%\System32\wbem\sppwmi.mof to see)
OIC... Thanx. BTW @OP, there's no way to determine the origin of activation only thing is to check for DE: Code: Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT LicenseStatusReason FROM SoftwareLicensingProduct WHERE LicenseStatus = 1",,48) For Each objItem in colItems If objItem.LicenseStatusReason=1074066433 Then Msgbox ( "Windows 10 on this device is activated with digital entitlement") Next
LicenseStatusReason (SoftwareLicensingProduct) Has anyone got a list of License Status Reason codes and what the codes mean?
There isn't a definitiive list - it reports 0x0 if SPP is happy otherwise the error code (blocked key or whatever) You can use this to test: Code: Add-Type -AssemblyName PresentationCore,PresentationFramework $Result = Get-WmiObject -Query "SELECT LicenseStatusReason FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND Description LIKE 'Windows%'" switch ($Result.LicenseStatusReason) { "0" { [System.Windows.MessageBox]::Show("Windows 10 on this device is activated with a product key") break;} "1074066433" { [System.Windows.MessageBox]::Show("Windows 10 on this device is activated with digital entitlement") break; } # Check error code Default {Invoke-Expression ("cmd.exe /c slui.exe 0x2a " + $Result.LicenseStatusReason)} }