Rearming Windows Server 2016 pass it's maximum rearm count period?

Discussion in 'Windows Server' started by riahc3, Jan 23, 2019.

  1. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    I want to keep rearming Windows Server 2016 pass it's maximum rearm count period. I don't mind touching the registry as this is for a lab.

    Can someone tell me how to do it on Windows Server 2016?
     
  2. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    #2 s1ave77, Jan 23, 2019
    Last edited: Jan 23, 2019
    Rearm is only usefull to reset any Initial Grace Period in Win 7 (the 30 days) and the Activation Grace Period in EVAL versions (limitted). In Win 8/Server 2012 and later non-EVAL versions there is no such Grace that can be resetted hence the Rearm is deprecated :thinking:.


    EDIT: Next time you might add that you use the EVAL (saw it in your reddit post). Iirc the rearm count cannot be resetted on EVALs, unlike Win 7 ;).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    This is evaluation and I know it can be done because I did it for another Server 2016....I just don't remember how.
     
  4. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    See my edit. You can't reset the rearm count on any EVAL without patching the kernel (same applies for the timebomb on IP builds) ;).

    You can convert EVAL to normal version on Server (in opposite to the client versions). Still that would need activation afterwards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    Are you 100% sure? I did it on a Server 2016 and it was a damn DC....
     
  6. whatever127

    whatever127 MDL PHP Wizard

    Nov 9, 2012
    1,050
    7,345
    60
    Windows 10 (and server probably) can have the rearm count reset almost the same way it is done in Windows 7. The difference is that you need to do the process from Windows PE or from Recovery environment and need to empty C:\Windows\system32\spp\store\2.0 directory.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Does that also apply for EVAL Grace Reset? For normal versions there is no gain in doing so. How to exceed 1001 rearms for no reason?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. whatever127

    whatever127 MDL PHP Wizard

    Nov 9, 2012
    1,050
    7,345
    60
    Doing rearm count reset resets completely license state, so you will have a brand new grace period.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    Could you please point out the process step by step?
     
  10. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    Nothing?
     
  11. whatever127

    whatever127 MDL PHP Wizard

    Nov 9, 2012
    1,050
    7,345
    60
    Ask @s1ave77, he should have needed information now.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    Not sure what you mean exactly... @s1ave77 said it was not possible while you are saying it is.

    I dont understand why he needs information. Did I miss something?
     
  13. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    For Windows 7 and Win 10 upto build 14393, so includes Server 2016 and LTSB 2016, try this (will reboot which is mandatory):
    Code:
    @echo off
    set /p "Sure=Are you sure you want to continue (y/N)? "
    if /I "[%Sure%]" == "[y]" goto :START_PROCESS
    goto :EOF
    
    :START_PROCESS
    echo Please wait...
    sc stop sppsvc
    reg add HKCU\SYSTEMM\WPA /ve /f
    REG SAVE HKCU\SYSTEMM "%TEMP%\SYSTEM.HIV" /y >NUL 2>&1
    REG RESTORE HKLM\SYSTEM "%TEMP%\SYSTEM.HIV" >NUL 2>&1
    reg delete HKCU\SYSTEMM /f
    del "%TEMP%\SYSTEM.HIV" >NUL 2>&1
    
    for /f %%i in ('reg query HKLM\SYSTEM\WPA') do reg delete "%%i" /f
    
    ::Windows 10
    if exist "%systemdrive%\Windows\System32\spp\store\2.0\cache" (
        attrib -s -h "%systemdrive%\Windows\System32\spp\store\2.0\cache"
        rmdir /q /s "%systemdrive%\Windows\System32\spp\store\2.0\cache"
    )
    if exist "%systemdrive%\Windows\System32\spp\store\2.0\data.dat" (
        attrib -s -h "%systemdrive%\Windows\System32\spp\store\2.0\data.dat"
        del "%systemdrive%\Windows\System32\spp\store\2.0\data.dat"
    )
    if exist "%systemdrive%\Windows\System32\spp\store\2.0\tokens.dat" (
        attrib -s -h "%systemdrive%\Windows\System32\spp\store\2.0\tokens.dat"
        del "%systemdrive%\Windows\System32\spp\store\2.0\tokens.dat"
    )
    
    ::Windows 7
    if exist "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" (
        attrib -s -h "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat"
        del "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat"
    )
    if exist "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache" (
        attrib -s -h "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache"
        rmdir /q /s "%systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache"
    )
    
    shutdown -r -t 0
    goto :EOF
    
    :EOF
    save as rearm.cmd and run as admin.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    @s1ave77 Careful mate. If @riahc3 doesn't like your script or it doesn't work according to him he will call it a f**kery.
     
  15. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    Trying now, thanks.
     
  16. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    This man needs a gold metal and a full salute. THANK YOU.

    Worked perfectly and now another 180 days.
     
  17. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    #17 s1ave77, Jan 31, 2019
    Last edited: Jan 31, 2019
    Nah, actually all this started with the old Win 7 Rearm Project and was revisited and adapted by others, i only collected the bread crumbs.

    For the sake of completeness (the forementioned version only supports Win 7 and Win 10 till build 14393) a version that will rearm Win 7/8.1/10 offline (needs to be performed from Win PE):
    Code:
    @echo off
    set "TargetLetter="
    for %%a in (Z Y W V U T S R Q P O N M L K J I H G F E D C) do (
        if exist "%%a:\Windows\system32\config\SYSTEM" set "TargetLetter=%%a:"
    )
    
    if "[%TargetLetter%]" == "[]" echo Cannot find target system & exit /b 1
    
    echo list volume | diskpart
    echo.
    
    echo Detected system on %TargetLetter%
    set /p "Sure=Are you sure you want to continue (y/N)? "
    if /I "[%Sure%]" == "[y]" goto :START_PROCESS
    goto :EOF
    
    :START_PROCESS
    REG LOAD HKLM\TEMP "%TargetLetter%\Windows\system32\config\SYSTEM"
    for /f %%i in ('reg query HKLM\TEMP\WPA') do reg delete "%%i" /f
    REG UNLOAD HKLM\TEMP
    
    ::Windows 10 ClipSVC
    if exist "%TargetLetter%\ProgramData\Microsoft\Windows\ClipSVC\tokens.dat" (
        attrib -s -h "%TargetLetter%\ProgramData\Microsoft\Windows\ClipSVC\tokens.dat"
        del "%TargetLetter%\ProgramData\Microsoft\Windows\ClipSVC\tokens.dat"
    )
    
    ::Windows 10 Insider
    if exist "%TargetLetter%\Windows\System32\spp\store_test\2.0\cache" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store_test\2.0\cache"
        rmdir /q /s "%TargetLetter%\Windows\System32\spp\store_test\2.0\cache"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store_test\2.0\data.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store_test\2.0\data.dat"
        del "%TargetLetter%\Windows\System32\spp\store_test\2.0\data.dat"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store_test\2.0\tokens.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store_test\2.0\tokens.dat"
        del "%TargetLetter%\Windows\System32\spp\store_test\2.0\tokens.dat"
    )
    
    ::Windows 10/8.1
    if exist "%TargetLetter%\Windows\System32\spp\store\2.0\cache" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\2.0\cache"
        rmdir /q /s "%TargetLetter%\Windows\System32\spp\store\2.0\cache"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store\2.0\data.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\2.0\data.dat"
        del "%TargetLetter%\Windows\System32\spp\store\2.0\data.dat"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store\2.0\tokens.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\2.0\tokens.dat"
        del "%TargetLetter%\Windows\System32\spp\store\2.0\tokens.dat"
    )
    
    ::Windows 8
    if exist "%TargetLetter%\Windows\System32\spp\store\cache" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\cache"
        rmdir /q /s "%TargetLetter%\Windows\System32\spp\store\cache"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store\data.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\data.dat"
        del "%TargetLetter%\Windows\System32\spp\store\data.dat"
    )
    if exist "%TargetLetter%\Windows\System32\spp\store\tokens.dat" (
        attrib -s -h "%TargetLetter%\Windows\System32\spp\store\tokens.dat"
        del "%TargetLetter%\Windows\System32\spp\store\tokens.dat"
    )
    
    ::Windows 7
    if exist "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" (
        attrib -s -h "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat"
        del "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat"
    )
    if exist "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache" (
        attrib -s -h "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache"
        rmdir /q /s "%TargetLetter%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\cache"
    )
    
    goto :EOF
    
    :EOF
    Give it a short name like rearm.cmd and copy it to the root of your Windows Drive/Partition. Boot any Windows ISO and in first screen hit Ctrl+F10 to get the CMD prompt, than enter:
    Code:
    echo list volume | diskpart
    This will show all available partitions. Choose your Windows drive letter (according to shown info) and enter:
    Code:
    x:rearm
    'X' being the actual drive letter. It's without any \.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    OK, this works offline without any modification on ANY version???
     
  19. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Is supposed to :D.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. riahc3

    riahc3 MDL Addicted

    Jul 29, 2009
    547
    34
    30
    The online script works great. Really good for testing long lab environments.

    I also ran it on Server 2019 and it works as well.

    Thank you.