Skip to main content
Solved

Extension attribute for Microsoft Office 2021

  • August 8, 2024
  • 4 replies
  • 36 views

Forum|alt.badge.img+3

I had this extension attribute that will tell me if the mac had Office 2016 or 2019 installed, I need one now for office 2021, can anyone help me modify it?

 

#!/bin/bash

wordVersion=$(defaults read "/Applications/Microsoft Word.app/Contents/Info.plist" CFBundleShortVersionString)
majorVersion=$(awk -F '.' '{print $1}' <<< "$wordVersion")
minorVersion=$(awk -F '.' '{print $2}' <<< "$wordVersion")

if [[ $majorVersion -ge "15" ]]; then
if [[ "$majorVersion" -ge "16" ]] && [[ "$minorVersion" -ge "17" ]]; then
echo "<result>2019</result>"
else
echo "<result>2016</result>"
fi
else
if [[ -d "/Applications/Microsoft Office 2011/" ]]; then
echo "<result>2011</result>"
else
echo "<result>Not Installed</result>"
fi
fi

exit 0

Best answer by jamf-42

maybe im missing the question,

add a patch management for each of the Office apps..

then you get version tracked..

4 replies

jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • Answer
  • August 8, 2024

maybe im missing the question,

add a patch management for each of the Office apps..

then you get version tracked..


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • August 12, 2024

Thanks for the suggestion, I was able to create a smart group based on the patch management info.


dlondon
Forum|alt.badge.img+14
  • Honored Contributor
  • August 14, 2024

Hi @ucdcastillo I use a script by @pbowden which you can find here https://github.com/pbowden-msft/ExtensionAttributes. It's called Office_License.sh


kwoodard
Forum|alt.badge.img+12
  • Valued Contributor
  • September 16, 2024

maybe im missing the question,

add a patch management for each of the Office apps..

then you get version tracked..


I'm actually trying to do this now. Do we have to provide the packages for each individual Office app, or is there some way to use the Jamf repository? If I can use the Jamf, how do I set that up? I'm slamming my head into a wall to do this.