Tuesday, September 18, 2018

Office 365 "Belongs to:" incorrect / activation

When re provisioning laptops and desktops that utilize Office 365 installations the subscription login doesn't update properly. Although this can be fixed as sugested by many by logging into the old users OWA account, Install Status, and deactivate this doesn't help any when the user account no longer exists.
The user can wait the 31 days until it begins to complain that it's unlicensed, but that's not good product administration in my opinion. I don't want my users to have to worry about it, period.

Logging out on the account page and logging back in also does not update the "belongs to" field.

Options:

  • Reinstall Office - wow, what a waste of time for something that should be easy
  • Do an online repair - Again, this works, but it takes awhile depending on your connection.
  • Run a quick script - YAY (but again, what the heck is MS thinking, this should be easy!)
Thanks to our good friends over at Spiceworks and in particular Marcragusa for this post.

additionally, there is a lot out there covering this once you know its an issue.

Open up a cmd prompt as administrator
  • cscript.exe "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" /dstatus
  • then run
  • cscript.exe "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" /unpkey:XXXXX

I have to do this fairly often so I slapped together a weak powershell file with this. Since I'm not overly skilled with PS I have to retype the last 5 of the key back in, but at least I don't have to remember the commands. Maybe someone can take the output of the first one and pull out the last 5 for the second command automagically.

Invoke-Command -ScriptBlock {cscript.exe "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" /dstatus}
$prodkey = Read-Host "Enter the last 5 characters of the product key"
Invoke-Command -ScriptBlock {cscript.exe "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" /unpkey:$prodkey} -ArgumentList $prodkey