Skip to main content
Solved

Scripted removal of Microsoft Office 2016 login keychain item

  • October 21, 2015
  • 6 replies
  • 16 views

Forum|alt.badge.img+11

Looking for a little help for a scripted removal of the Office 2016 login keychain item (credentials). The 'kind' begins with "MicrosoftOffice15_2_Data:ADAL:.....ends in long alphanumeric string".

When doing a clean uninstall of the Office suite it would be nice to be able to automate the removal of this item as well.

thanks in advance for any help!

Best answer by davidacland

So after a bit of playing around, the security command seems ok with security delete-internet-password -s msoCredentialSchemeADAL.

6 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • October 21, 2015

Your going to want security delete-internet-password -a long alphanumeric string.

Is the long alphanumeric string the same across all Macs? If it is it will be pretty easy.


Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • October 21, 2015

@davidacland , thanks. looks like the string will be different across Macs but the first part should be the same: MicrosoftOffice15_2_Data:ADAL


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • Answer
  • October 23, 2015

So after a bit of playing around, the security command seems ok with security delete-internet-password -s msoCredentialSchemeADAL.


bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • October 23, 2015

Doesn't deleting the licensing .plist also prompt the user for the licensing information when re-installed?

Presumably this is the O365 activated suite, if so... then is the users password set to expire after x days?

I'm all for completeness, but wonder if these additional steps are needed.


Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • October 23, 2015

@davidacland thanks for the help on this!

@bentoms Yes, this is an O365 activated Office suite. So far in my testing deleting the licensing .plist (~/Library/Group Containers/UBF8T346G9.Office/com.microsoft.Office365.plist) as part of the uninstall does not cause the user to be prompted again once Office is reinstalled, as long as the keychain item remains. Good thought on the password expiry, on our dev tenant our passwords are not set to expire but I'll have to keep an eye on that once we get our production environment running.

We're testing with a couple of different O365 tenants so its great to have a clean reinstall.


bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • October 24, 2015

@mapurcel good info. Thanks for coming back with it.