1. Remove Office 365 license for Subscription based installs (not Shared Computer Licensing scenarios):
To remove the Office 365 license, you must run two cscript command lines. The command lines are:
A. Run C:\program files (x86)\Microsoft office\office16>cscript ospp.vbs /dstatus
The above command line will generate a report of the currently installed/activated license. (See Below)
NOTE: You might see multiple licenses in the /dstatus report.
B. Make note of value for “Last 5 characters of installed product key”
C. Run C:\program files (x86)\Microsoft office\office16>cscript ospp.vbs /unpkey:“Last 5 of installed product key” For example: C:\program files (x86)\Microsoft office\office16>cscript ospp.vbs /unpkey:WB222 (See Below) Repeat the step above if necessary until all keys are removed.
After running the /unpkey: command line you will see a “Product Key uninstall successful” message. You can now close the Command Prompt and move onto Step 2.
2. Remove cached identities in HKCU registry:
A. In the Registry Editor navigate to HKCU\Software\Microsoft\Office\15.0 or 16.0\Common\Identity\Identities and remove all of the identities under \Identities.
NOTE: If using Shared Computer Licensing remove the above Identities from HKEYUsers\SID.
3. Remove the stored Credentials in the Credential Manager:
A. Open Control Panel > Credential Manager. Remove all Windows credentials listed for Office15 or Office16.
B. To remove the Credential Click on the Drop down arrow and choose Remove from Vault.(See Below)
Shared Computer Licensing scenarios you must remove the Token and identities listed below.
File Location Appdata\local\Microsoft\Office\15.0 or 16.0\Licensing
4. Persisted locations that must be cleared
Credential Manager:
Appdata\Roaming\Microsoft\Credentials
Appdata\Local\Microsoft\Credentials
Appdata\Roaming\Microsoft\Protect
HKCU\Software\Microsoft\Protected Storage System Provider
Office 365 activation Tokens and Identity
Appdata\local\Microsoft\Office\15.0 or 16.0\Licensing
HKCU\Software\Microsoft\Office\15.0 or 16.0\Common\Identity
HKEYU\(The Users SID)\Software\Microsoft\Office\15.0 or 16.0\Common\Identity
The above steps will reset the activation state for Office 365(2013/2016). The activation flow after the locations are cleared will represent an initial activation.