Distribute the future // Kelvin Quee

Resetting Office licenses on the Mac

If you're faced with this particular error when trying to activate your Office license on the Mac:

"Another account from your organization is already signed in on this device. Try again with a different account."

You may resolve it by using this tool, Office-Reset, from Paul Bowden.

Running a binary without source code is always a bad idea though. I took the trouble of extracting it to review the scripts within. It reads something like this:

echo "Office-Reset: Starting postinstall for Reset_Factory"
autoload is-at-least

GetLoggedInUser() {
    LOGGEDIN=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/&&!/loginwindow/{print $3}')
    if [ "$LOGGEDIN" = "" ]; then
        echo "$USER"
    else
        echo "$LOGGEDIN"
    fi
}

SetHomeFolder() {
    HOME=$(dscl . read /Users/"$1" NFSHomeDirectory | cut -d ':' -f2 | cut -d ' ' -f2)
    if [ "$HOME" = "" ]; then
        if [ -d "/Users/$1" ]; then
            HOME="/Users/$1"
        else
            HOME=$(eval echo "~$1")
        fi
    fi
}

## Main
LoggedInUser=$(GetLoggedInUser)
SetHomeFolder "$LoggedInUser"
echo "Office-Reset: Running as: $LoggedInUser; Home Folder: $HOME"

echo "Office-Reset: Stopping apps and services"
/usr/bin/pkill -9 'Microsoft Word'
/usr/bin/pkill -9 'Microsoft Excel'
/usr/bin/pkill -9 'Microsoft PowerPoint'
/usr/bin/pkill -9 'Microsoft Outlook'
/usr/bin/pkill -9 'Microsoft OneNote'
/usr/bin/pkill -9 'OneDrive'
/usr/bin/pkill -9 'FinderSync'
/usr/bin/pkill -9 'OneDriveStandaloneUpdater'
/usr/bin/pkill -9 'OneDriveUpdater'
/usr/bin/pkill -9 'Microsoft Teams*'
/usr/bin/pkill -9 'Microsoft AutoUpdate'
/usr/bin/pkill -9 'Microsoft Update Assistant'
/usr/bin/pkill -9 'Microsoft AU Daemon'
/usr/bin/pkill -9 'Microsoft AU Bootstrapper'
/usr/bin/pkill -9 'com.microsoft.autoupdate.helper'
/usr/bin/pkill -9 'com.microsoft.autoupdate.helpertool'
/usr/bin/pkill -9 'com.microsoft.autoupdate.bootstrapper.helper'
/usr/bin/pkill -9 'com.microsoft.teams2.launcher'

exit 

Nothing malicious and does exactly what it says. A little digging around shows that Paul also published another script called Unlicense on Github that does the same.

Worked brilliantly for me. Hope this helps and saves you from hours of wading through Microsoft's support forums. :P

Thoughts? Leave a comment