–Remove the Identities folder from the Registry
Office 2016:
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity\Identities and delete the “Identities” folder
Office 2015:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Identity\Identities and delete the “Identities” folder
–Run the scripts mentioned in below by running the command prompt as administrator
Office 2016:
============
cscript.exe “%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs” /dstatus
cscript.exe “%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs” /unpkey:XXXXX
Office 2015:
===========
cscript.exe “%ProgramFiles(x86)%\Microsoft Office\Office15\ospp.vbs” /dstatus
cscript.exe “%ProgramFiles(x86)%\Microsoft Office\Office15\ospp.vbs” /unpkey:XXXXX
XXXXX is the last 5 digits of the Office key that is displayed from the /dstatus switch
–Launch Office applications and activate with Office 365 credentials