Multi-OEM/Retail Project {MRP} - Mk3

Discussion in 'MDL Projects and Applications' started by mxman2k, Oct 15, 2016.

  1. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,771
    7,713
    210
    I'm getting that, too (no Office and was never installed).

    Code:
    Windows VL Key Management  - Yes
    VL Activation Type         - Unknown/Custom
    Activation Interval Time   - 0 days / 0 minutes 
    Even if KMS is enabled in Windows 7 Pro, the information does not show.

    Could you tell the queries you do for this information, so I can see what nonsense is displayed by the original query, before it's sanitized by QT?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    Sure give me a min to pull up the QT code in the editor. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4263 mxman2k, Nov 26, 2018
    Last edited: Nov 26, 2018
    (OP)
    Converted the routine into a simple script this uses the exact same routine i just missed off the re-directions to the log files.

    Code:
    @echo off
    
    echo This takes a few seconds to process...
    echo.
    
    SET GetParms=EvaluationEndDate^,GenuineStatus^,GracePeriodRemaining^,IsKeyManagementServiceMachine^,KeyManagementServiceMachine^,DiscoveredKeyManagementServiceMachineIpAddress^
    ,KeyManagementServicePort^,LicenseIsAddon^,VLActivationType^,VLActivationInterval^,VLActivationTypeEnabled^,VLRenewalInterval^,LicenseStatus^,ProductKeyChannel
    
    FOR /F %%A IN ('"WMIC PATH SoftwareLicensingProduct WHERE (Name LIKE 'Windows%%' AND PartialProductKey is not NULL) GET %WGetParms% /VALUE" 2^>nul') DO ( SET "%%A" ) >nul
    
    SET "KMSInstalled=No"
    IF /I "%IsKeyManagementServiceMachine%"=="0" SET "KMSInstalled=No"
    IF /I "%IsKeyManagementServiceMachine%"=="1" SET "KMSInstalled=Yes"
    rem IF /I "%KeyManagementServicePort%"=="0" SET "KMSInstalled=No"
    rem IF /I "%KeyManagementServicePort%" NEQ "0" SET "KMSInstalled=Yes"
    
    IF /I "%KMSInstalled%"=="No" GOTO :ProcessReasonCodes
    IF NOT DEFINED KMSInstalled GOTO :ProcessReasonCodes
    echo Checking for any KMS status...
    
    REM VLActivationType = 1 AD , 2 KMS, 3 Token, 0 ALL
    SET "VLActivationTypeT="
    IF NOT DEFINED VLActivationType SET "VLActivationTypeT=Unknown/Custom"
    IF /I "%VLActivationType%"=="0" SET "VLActivationTypeT=Customized {0}"
    IF /I "%VLActivationType%"=="1" SET "VLActivationTypeT=Active Directory {1}"
    IF /I "%VLActivationType%"=="2" SET "VLActivationTypeT=KMS {2}"
    IF /I "%VLActivationType%"=="3" SET "VLActivationTypeT=Token {3}"
    IF /I "%VLActivationType%"=="4" SET "VLActivationTypeT=Specialized {4}"
    IF /I "%VLActivationType%"=="5" SET "VLActivationTypeT=Specialized {5}"
    
    IF NOT DEFINED GracePeriodRemaining GOTO :VLActivationIntervalCheck
    IF /I "%GracePeriodRemaining%"=="0" SET "VLGraceRemainingTime=" & GOTO :VLActivationIntervalCheck
    
    :VLActivationIntervalCheck
    IF /I "%VLActivationInterval%"=="0" SET "VLActivationInterval=" & GOTO :BypassVLIntervalCheck
    set "VLActivationIntervalDays=0"
    IF "%VLActivationInterval%" GTR "0" set /a "VLActivationIntervalDays=%VLActivationInterval%/1440"
    IF "%VLActivationInterval%" LSS "1" SET "VLActivationInterval=0"
    IF "%VLActivationIntervalDays%"=="" SET "VLActivationIntervalDays=0"
    IF "%VLActivationIntervalDays%"==" " SET "VLActivationIntervalDays=0"
    
    :BypassVLIntervalCheck
    set "VLRenewalIntervalDays=0"
    IF /I "%VLRenewalInterval%"=="0" SET "VLRenewalInterval=" & GOTO :ProcessReasonCodes
    IF "%VLRenewalInterval%" GTR "1" set /a "VLRenewalIntervalDays=%VLRenewalInterval%/1440"
    IF "%VLRenewalInterval%" LSS "1" SET "VLActivationInterval=0"
    IF "%VLRenewalIntervalDays%"=="" SET "VLRenewalIntervalDays=0"
    IF "%VLRenewalIntervalDays%"==" " SET "VLRenewalIntervalDays=0"
    
    :ProcessReasonCodes
    
    echo Results - if anything...
    IF /I "%KMSInstalled%"=="Yes" (
    echo Windows VL Key Management  - %KMSInstalled%
    
    IF DEFINED VLActivationTypeT echo VL Activation Type         - %VLActivationTypeT%
    
    IF DEFINED VGraceRemainingTime echo Remaining Time Allowance   - %VLGraceRemainingTime% minutes
    
    IF DEFINED VLActivationInterval echo Activation Interval Time   - %VLActivationIntervalDays% days / %VLActivationInterval% minutes
    
    IF DEFINED VLRenewalInterval echo Renewal Interval Time      - %VLRenewalIntervalDays% days / %VLRenewalInterval% minutes
    )
    
    echo.
    pause
    The routine may look odd to some, but the FOR loop creates the variable names from the GetParms variable. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4264 mxman2k, Nov 26, 2018
    Last edited: Nov 26, 2018
    (OP)
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4265 mxman2k, Nov 26, 2018
    Last edited: Nov 26, 2018
    (OP)
    KeyManagementServicePort

    Have REM'd them out in the script above and will remove the lines in the QT itself.

    This may be the reason it sets the trigger as it is seeing the Office KMS version's port !

    Damn i knew i messed something up :g:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. AsaadSoft

    AsaadSoft MDL Addicted

    Jul 29, 2015
    542
    171
    30

    and why it doesn't show more information about the motherboard or at least the model number or something ?
    or the exact graphics memory size ?

    Capture.JPG

    i have office 2019 installed and activated using microsoft toolkit after converting it to VL,
    and autokms process is scheduled to keep it activated
     
  7. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4267 mxman2k, Nov 26, 2018
    Last edited: Nov 27, 2018
    (OP)
    The information the WMIC calls/Registry return is what the QT displays, it cannot produce information that does not exist!

    Have edited the QT and hopefully it will show more motherboard information...
    The Serial Number will not be shown on the saved report for security reasons.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4268 mxman2k, Nov 27, 2018
    Last edited: Nov 27, 2018
    (OP)
    QT v79.1 uploaded, 2nd post download link, password and hashes updated.

    Quick fix for KMS/VL detection, hopefully this will prevent weird information that should no longer show if KMS was not used for Windows but was just for MS Office.

    + Added more motherboard information - if it is available.

    -------------------------
    Let's see how this one works!

    For motherboard i have added Model Name (usually seems to be blank so won't show), Serial Number (not shown on saved report), Product Name which should be the same as what is shown under #03 in the summary area.

    Graphics memory is what i can obtain from WMIC etc, hence why it says may not be accurate! -- If the Gfx ram is via system ram it can automatically adjust for what is required so the results will vary.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,771
    7,713
    210
    #4269 Carlos Detweiller, Nov 27, 2018
    Last edited: Nov 27, 2018
    Well, that's what I meant: Even if I HAVE KMS active, it doesn't detect it. QT 79.0 did only detect the KMS port, and thus triggered the routine which revealed no results. It is as if Windows 7 does not support the variable you are testing for.
    I'll try a Windows 8.1... Nope, also is set to 0.

    Maybe that variable is only for the official KMS Server role? With CSVLK installed? Then it cannot detect KMS clients, only official servers.

    Edit: Checked Windows 7, 8.1, 10, Server 2012R2 test VMs, all revealed

    IsKeyManagementServiceMachine=0


    Maybe you should use the "VOLUME_KMSCLIENT channel" string as trigger, the intervals are definitely inside the WMIC query.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    #4270 mxman2k, Nov 27, 2018
    Last edited: Nov 27, 2018
    (OP)
    You are right i followed the 'official' KMS route, which i thought all the 'emulators' emulated as well, but it seems not always.

    If i use the Volume_KMSClient check then i would hit the same roadblock because if Windows was not activated via KMS but Office was - it may still give same false results because they both share the same mechanism/calls.

    The odd thing is, in testing the routine, it would seem to work correctly with Aboddi's KMS_VL_ALL, i personally not use KMS for any machine, only for testing, majority of the time the test pc's are not even activated as once the MRP test is completed the pc is usually wiped and setup for another OS/Edition test.

    What puzzles me is that in the M$ documentation for the SoftwareLicensing Class WMI it states at the bottom:

    Requirements
    Minimum supported client
    Windows 7
    Minimum supported server
    Windows Server 2008 R2

    So for Vista/S2008 i disable the check as it not supported... There is a version for those OS's but i not wanted to add more code for them that would only be used rarely.


    I will dig deeper and more research - if it not produce a viable solution then the routine will be disabled/removed and do only the check for Office.

    I knew activation/licensing was a pain but gez this is a whole new level. :D

    What is interesting is that it shows that M$ have the upper hand in that they can detect a non genuine KMS which maybe one of the ways Defender was programmed to sniff out!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,211
    90,794
    340
    ProductKeyChannel,VLActivationType,VLActivationTypeEnabled,DiscoveredKeyManagementServiceMachineIpAddress
    does not exist in Windows 7 SoftwareLicensingProduct, so the whole wmic query will fail

    detect if Windows is KMS-capable
    Code:
    wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i Windows 1>nul && (set wVOL=1) || (set wVOL=0)
    detect if current Windows key is KMS
    Code:
    wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get Name 2>nul | findstr /i Windows 1>nul && (set wGVLK=1) || (set wGVLK=0)
    detect if Windows is currently activated with KMS
    Code:
    wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' and LicenseStatus='1') get Name 2>nul | findstr /i Windows 1>nul && (set wKMS=1) || (set wKMS=0)
     
  12. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    I was just attempting to do it another way with multiple checks, but that is far less code :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    my attempted method(s)...
    Code:
    SET "KMSPermitted="
    SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="Volume_KMSClient" SET "KMSPermitted=Yes" & SET "KMSInstalled=KMS_Client"
    IF /I "%ProductKeyChannel%"=="VOLUME_MAK" SET "KMSPermitted=Yes" & SET "KMSInstalled=MAK"
    IF /I "%ProductKeyChannel%"=="VOLUME_KMS_W10" SET "KMSPermitted=Yes" & SET "KMSInstalled=KMS_W10"
    IF /I "%ProductKeyChannel%"=="VOLUME_KMS_W7" SET "KMSPermitted=Yes" & SET "KMSInstalled=KMS_W7"
    
    IF /I "%ProductKeyChannel%"=="RETAIL" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="OEM_DM" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="OEM_COA_NSLP" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="OEM_SLP" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="OEM_COA_SLP" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="TIMEBASED_SUB" SET "KMSPermitted=" & SET "KMSInstalled=No"
    IF /I "%ProductKeyChannel%"=="TIMEBASED_EVAL" SET "KMSPermitted=" & SET "KMSInstalled=No"
    
    IF NOT DEFINED KMSPermitted IF /I "%IsKeyManagementServiceMachine%"=="1" SET "KMSInstalled=KMS_Key_Management {1}"
    I was trying to detect which VL method was used, but with my luck so far i guess that may of failed too :D:D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,211
    90,794
    340
    VOLUME_KMS_W* is used for CSVLKs, not current Windows edition :)
     
  15. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    ah-ah! You can tell i not into all this KMS/MAK etc :D:D

    I 'almost' got things right, just a bit off in the way i went about it :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. AsaadSoft

    AsaadSoft MDL Addicted

    Jul 29, 2015
    542
    171
    30
  17. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    Is the most important part ;)

    To show other partitions gets a bit complex so i left those out.

    Maybe once i get these other bits sorted i will find time to check any other partition information on drive 0, 1, 2 etc...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    Hopefully i have the KMS routine sorted now, with the help from @abbodi1406 and some of my OCD checking it *should* now show the correct info for Windows VL activation...

    Have to do some w7 Pro/w10 installs, check with the QT then install Office then check again...

    One way or another i will get the information correct, i don't give up too easy, at times i get frustrated like we all do, but i soon attack the problem again head on until i beat the bas---d into submission. :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,894
    10,735
    240
    ^^^
    Hi bro, you're getting better every day ....thanks a lot :):hug2::worthy:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,324
    21,067
    210
    OK sofar in testing...
    No activation / No Office installed: (snippet)
    Code:
    License Status Reason      - 0xC004F034: License not found/invalid or could not connect to the Activation Server.
     
    Wifi Adaptor Status        - Not detected or driver not installed.
     
    Microsoft Office Detected  - None.
     
    Windows VL Key Management  - Not Detected. 
    Windows KMS activated / No Office installed: (snippet)
    Code:
    License Status Reason      - 0x00000000: Accepted key of OEM SLP, COA, Retail or Volume/MAK was used.
     
    Wifi Adaptor Status        - Not detected or driver not installed.
     
    Microsoft Office Detected  - None.
    
    Windows VL Key Management  - Volume:GVLK {Via PKC}
    VL Activation Type         - KMS {2}
    Activation Interval Time   - 0 days / 120 minutes
    Renewal Interval Time      - 7 days / 10080 minutes 
    Windows & Office KMS activated: (snippet)
    Code:
    License Status Reason      - 0x00000000: Accepted key of OEM SLP, COA, Retail or Volume/MAK was used.
     
    Wifi Adaptor Status        - Not detected or driver not installed.
     
    Microsoft Office Detected  - MS Office 2010 [Licensed]
    Activation Time Remaining  - 179 Days / 259163 Minutes
     
    Windows VL Key Management  - Volume:GVLK {Via PKC}
    VL Activation Type         - KMS {2}
    Activation Interval Time   - 0 days / 120 minutes
    Renewal Interval Time      - 7 days / 10080 minutes 

    If Windows is already activated be it via retail key, MSDM key, HWID or 'other methods ie Loader for 7' then only MS Office will show any data for remaining time information, or None if not installed, cannot be determined or via a retail office product key.

    Next installing Windows 7 (Pro) and repeat same tests.

    Slowly getting there!

    Once tested on 7 and passes then this will become QT v80.0 :)

    At this rate of changes and updates the QT will catch up with the MRP version. :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...