Fix Microsoft 365 apps activation issue

I am currently testing deployment of the MS 365 apps. But we are running into the following error when users are trying to activate the MS 365 apps: Another account from your organization is already signed in on this computer. Enter a product key instead. This happens when users are already signed into older Office versions with their old User Principale Name (UPN) and it was changed was changed before the installation of the MS 365 apps. In this post I will explain the issue and show the solution to prevent this issue and to fix it when you have got the activation issue.

The best way to prevent the issue from happening is to be sure that there are no users signed into the older office versions. Userd dot have to be signed in for Office versions like 2016 or 2019 to function correctly.

If an user is signed into Office it will we shown in the register of the user (In this case Office 2016):


If you remove Identity you can be sure that no account is signed in anymore.

But you don’t want to remove Identities if the user already hase got the MS 365 apps installed and activated. So I created a PowerShell script:

#Script to remove Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Identity to prevent sign in issues after 365 app deployment and upn change
#Auteur: Remy Kuster

#Check if MS 365 Apps allready are installed

$uninstallKeys = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

$O365 = "Microsoft 365 Apps*"
$O365Check = $uninstallKeys | Where-Object { $_.GetValue("DisplayName") -like $O365 }

if ($O365Check) {

 Write-Output -Message "365 Apps already installed" -Level Error
 Exit 1 


#Check if Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Identity is not present

$checkKey = Test-path "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Identity"

if (!$checkkey) {

 Write-Output -Message "Identity key does not exist" -Level Error
 Exit 1 


#Close open Office applications

Get-Process -Name Winword, excel, outlook, powerpnt, onenote, mspub, visio, winproj -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue

#Remove Identity

Remove-Item HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Identity -Recurse -Force -ErrorAction SilentlyContinue

The script will first check if the MS 365 Apps are installed, if they are the script will exit and do nothing.

If the MS 365 apps aren’t installed it will check if Identity is present, if it is not present the script will exit otherwise the script will first close all Office applications that cloud be open. Because if you try and delete Identity while an office application is running it won’t be deleted.

When the Office applications are closed the regkey will be deleted.

If a user has got the issue when trying to activate the MS 365 apps you can do the same to fix it.

Theme: Overlay by Kaira