Site icon Practical Guides for a System Administrator for Windows, Linux

Backup and Restore Microsoft Windows and Microsoft Office License Activation Offline

For various reasons I needed to SAVE the license of an already activated on a PC or Server with a Microsoft Windows 10, Windows 11, or even the Microsoft Windows Server 2022 operating system, and then reinstall the operating system and restore the license, already activated in the previous installation, OFFLINE. Because there was no working internet connection to proceed with the reactivation, or simply to reactivate the company PCs more quickly.

This procedure also applies to copies of Microsoft Office 2016, Microsoft Office 2019, Microsoft Office 2021, already activated on the same Computer or Server.

The procedure works only if the (Legitimate) copies were already activated and the restore is performed on the same PC or Server after a reinstallation.

Otherwise, restoring activation does NOT work if performed on a different PC (Better Specify).

The advantage of restoring an already activated license is that you can reinstall the operating system and then install Office WITHOUT re-entering any serial number.

If you use this procedure with scripts you can automate and restore your PCs or Servers faster. So instead of wasting time on serials and activation procedures with a few steps you already have a ready system.

I will briefly describe the procedure step by step, but I recommend using the script, because it is much faster in executing the procedure and it avoids the problem that the “Microsoft Software Protection Service Platform (sppsvc)” service may reactivate before the procedure is completed.

The license save and restore scripts are also available on my github repository here: https://github.com/thelogh/save_restore_activation_microsoft_license

With this procedure we save both the already activated license of the Microsoft Windows 10, Windows 11, Microsoft Windows Server 2022 operating system, and the already activated license of the Microsoft Office 2016, Microsoft Office 2019, Microsoft Office 2021 programme.

Prerequisites:

Let’s connect a USB stick formatted only NTFS (to not alter the permissions) let’s assume that the letter D: is assigned to it.

We create two directories inside it, one called “license” and one “GenuineTicket“.

We copy the PsExec.exe file contained in the PSTools.zip package, which can be downloaded here https://download.sysinternals.com/files/PSTools.zip, to the root of the USB stick.

Now we are ready

Let’s open a command prompt with Administrator Privileges.

Position ourselves inside the USB stick D:

D:

Now let’s stop the “Client License Service” and “Microsoft Software Protection Service Platformservices to allow us to copy files safely.

Stop the “Client License Service (ClipSVC)” service:

net stop clipsvc

Stop the “Microsoft Software Protection Service Platform (sppsvc)” service:

net stop sppsvc

Now let’s copy the contents of the folder “C:\Windows\System32\spp\store” into the “license” folder on the USB stick.
To avoid altering the permissions, we use xcopy.

https://learn.microsoft.com/it-it/windows-server/administration/windows-commands/xcopy

xcopy C:\Windows\System32\spp\store .\license /O /X /E /H /K /Y

Copy the “tokens.dat” file into the “GenuineTicket” folder on the USB stick:

xcopy C:\ProgramData\Microsoft\Windows\ClipSVC\tokens.dat .\GenuineTicket /O /X /H /K /Y

Now we need to copy the contents to the registry key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control{7746D80F-97E0-4E26-9543-26B41FC22F79}” which is accessible ONLY by System Account, so we will use Psexec.exe program to access this registry key and save it.

psexec -i -s -accepteula reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\{7746D80F-97E0-4E26-9543-26B41FC22F79} .\winactivationkey.reg

The key will be saved in the “C:\Windows\System32\” folder.

Copy the registry key to the root of our USB stick:

copy C:\Windows\System32\winactivationkey.reg .\

Delete the key saved in “C:\Windows\System32\”

del C:\Windows\System32\winactivationkey.reg

If we need to save only the activation of Microsoft Office, we will only need to save the contents of “C:\Windows\System32\spp\storewithout the tokens.dat and the registry key.

Now once you have saved your activations, you can proceed with formatting your PC or Server.

The complete script for saving the activation can also be downloaded here: https://github.com/thelogh/save_restore_activation_microsoft_license

rem Offline script to save and restore activation for Microsoft Windows and Office licenses by Thelogh
rem Backup and Restore Microsoft Windows and Microsoft Office License Activation Offline
rem https://www.alldiscoveries.com/backup-and-restore-microsoft-windows-and-microsoft-office-license-activation-offline/
rem For all requests write on the blog
rem REPOSITORY
rem https://github.com/thelogh/save_restore_activation_microsoft_license
rem V.1.0.0
net stop clipsvc
net stop sppsvc

xcopy C:\Windows\System32\spp\store .\license /O /X /E /H /K /Y
net stop clipsvc
net stop sppsvc
xcopy C:\ProgramData\Microsoft\Windows\ClipSVC\tokens.dat .\GenuineTicket /O /X /H /K /Y

psexec -i -s -accepteula reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\{7746D80F-97E0-4E26-9543-26B41FC22F79} .\winactivationkey.reg

copy C:\Windows\System32\winactivationkey.reg .\

del C:\Windows\System32\winactivationkey.reg

Restore Procedure

Warning! Do not connect your PC or SERVER to the internet until the license has been restored.

Reinstall the operating system even WITHOUT serial, but specifying the correct version of Microsoft Windows available to you (Home, Pro) Or for the Microsoft Windows Server version (Standard, Datacenter), once installed proceed with the installation of Microsoft Office, perhaps via ISO. Once installed we proceed immediately to restore the licenses.

We connect the USB stick containing our license to the PC or Server.

Open a command prompt with Administrator Privileges.
Position ourselves inside the USB stick in this case D:

D:

Now stop the “Client License Service” and “Microsoft Software Protection Service Platform” services to allow us to overwrite the files safely.

Stop the “Client License Service (ClipSVC)” service:

net stop clipsvc

Stop the “Microsoft Software Protection Service Platform (sppsvc)” service:

net stop sppsvc

Overwrite the contents of the directory “C:\Windows\System32\spp\store\2.0“:

xcopy .\license\2.0\ C:\Windows\System32\spp\store\2.0 /O /X /E /H /K /Y

Overwrite the “tokens.dat” file:

xcopy .\GenuineTicket\tokens.dat C:\ProgramData\Microsoft\Windows\ClipSVC /O /X /H /K /Y

Copy the registry file to be restored to “C:\Windows\System32“:

copy /Y .\winactivationkey.reg C:\Windows\System32\winactivationkey.reg

Restore the registry:

psexec -i -s -accepteula reg import C:\Windows\System32\winactivationkey.reg

Delete the registry file:

del C:\Windows\System32\winactivationkey.reg

ATTENTION !!! RESTART THE MACHINE IMMEDIATELY !!!

shutdown /r /t 0

When you restart Microsoft Windows and Microsoft Office will already be activated without having connected to the Internet.

If for some reason it does not activate, repeat the restore procedure, perhaps waiting a few minutes for all the services to start and then relaunch the commands. I remind you that in this case the best solution is to use a script.

The complete script for the restore can also be downloaded here: https://github.com/thelogh/save_restore_activation_microsoft_license

rem Offline script to save and restore activation for Microsoft Windows and Office licenses by Thelogh
rem Backup and Restore Microsoft Windows and Microsoft Office License Activation Offline
rem https://www.alldiscoveries.com/backup-and-restore-microsoft-windows-and-microsoft-office-license-activation-offline/
rem For all requests write on the blog
rem REPOSITORY
rem https://github.com/thelogh/save_restore_activation_microsoft_license
rem V.1.0.0

net stop clipsvc
net stop sppsvc
xcopy .\license\2.0\ C:\Windows\System32\spp\store\2.0 /O /X /E /H /K /Y
xcopy .\GenuineTicket\tokens.dat C:\ProgramData\Microsoft\Windows\ClipSVC /O /X /H /K /Y
copy /Y .\winactivationkey.reg C:\Windows\System32\winactivationkey.reg
psexec -i -s -accepteula reg import C:\Windows\System32\winactivationkey.reg
del C:\Windows\System32\winactivationkey.reg
shutdown /r /t 0

If you want to reactivate only Microsoft Office even via the Online installer, once the installation is done without starting anything, disconnect it from the internet, stop the services and you can proceed to restore only the content in “C:\Windows\System32\spp\store\2.0” and immediately RESTART the machine.

By doing this you can reactivate Microsoft Office also through the Online installation package, once Office is active you can reconnect the system to the Internet.

If you need help or want to give suggestions, feel free to contact me on My Linkedin profile https://www.linkedin.com/in/valerio-puglia-332873125/

Exit mobile version