Skip to main content
Solved

Extension Attribute To Display MS Office Versions


Forum|alt.badge.img+10

Hello all,

I need help creating 2 Extension Attributes – 1 for Office 2011 & the other for Office 2008 – to display this info for inventory. I’ve been searching around for this, but so far no luck – I’d appreciate it if someone can help me with this. Thank you.

Best answer by dpertschi

I think this would do it, modify similarly for 2011.
Not sure if there is a more stable place to find it, like a package receipt or not. With an explicit path like this you have to hope all machines are alike.

#!/bin/sh
??Office08Version=`/usr/bin/defaults read /Applications/Microsoft Office 2008/Microsoft Word.app/Contents/Info CFBundleVersion`?
echo "<result> $Office08Version </result>"??

exit 0

Or, since your collecting this via recon anyway, you could make smart groups to find certain versions or use Inventory to report the same.

View original
Did this topic help you find an answer to your question?

12 replies

dpertschi
Forum|alt.badge.img+19
  • Contributor
  • 459 replies
  • Answer
  • August 3, 2012

I think this would do it, modify similarly for 2011.
Not sure if there is a more stable place to find it, like a package receipt or not. With an explicit path like this you have to hope all machines are alike.

#!/bin/sh
??Office08Version=`/usr/bin/defaults read /Applications/Microsoft Office 2008/Microsoft Word.app/Contents/Info CFBundleVersion`?
echo "<result> $Office08Version </result>"??

exit 0

Or, since your collecting this via recon anyway, you could make smart groups to find certain versions or use Inventory to report the same.


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1900 replies
  • August 3, 2012

Several years ago (Office 2004 days) Microsoft didn't update the version numbers of all applications. They would only rev the applications that were actually updated. We asked them to provide a means of knowing the current overall version and they responded with "use the version number from the Office Component Plugin". That file's version was updated every time.

Today, updates for Office 2008 and 2011 rev each application's version number whether it's actually updated or not. If you just choose an application such as Word and go by its version number then you don't need to use an extension attribute. That information is already collected by Casper.

If you'd prefer to go the old-school method of using the Office Component Plugin (that's what I do) then this should work for Office 2011:

#!/bin/sh

if [ -d /Applications/Microsoft Office 2011 ] ; then
    RESULT=$( defaults read /Applications/Microsoft Office 2011/Office/MicrosoftComponentPlugin.framework/Versions/14/Resources/Info CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
else
    echo "<result>Not Installed</result>"
fi

If the script finds the existence of the directory "Microsoft Office 2011" in the Applications folder then it will proceed to read the version number in the Component Plugin framework. Otherwise, it will report "Not Installed".

Office 2008 should be similar. You'll just need to adjust the path.


Forum|alt.badge.img+10
  • Author
  • Contributor
  • 48 replies
  • August 3, 2012

Thank you talkingmoose & dpertschi for your response - both helped achieve this task - appreciate your input!

Great weekend!


Forum|alt.badge.img+6
  • Contributor
  • 79 replies
  • May 9, 2013

Forum|alt.badge.img+9
  • Employee
  • 78 replies
  • May 9, 2013

Hi quedayone -

If there is an extension attribute posted in the discussions, please encourage the community to upload them to the Extension Attributes repository for the proper Third Party Product.

For example, the Extension Attribute above for Microsoft Office can be uploaded here: https://jamfnation.jamfsoftware.com/uploadFile.html?productID=4&type=1.

It is great to see this repository continue to grow and be useful for the community. Also, if you have any feedback on how we can make this more useful, please let us know! Thanks!


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1900 replies
  • May 19, 2013

It's there now. :-)


Forum|alt.badge.img+13
  • Valued Contributor
  • 478 replies
  • May 20, 2013

Jake:

- A link to "Extension Attributes" that's paginated, categorized, and searchable. - The ability to "vote up" and comment on EA's for effectiveness and good form
- Import/Export that works reliably*

*This might be people trying to create XML manually, so I'm not quite sure if that's JAMF's problem or user error.


Forum|alt.badge.img+9
  • Employee
  • 78 replies
  • May 30, 2013

Hey Josh - Love the feedback. Thank you!

Jake


Forum|alt.badge.img+8
  • Contributor
  • 47 replies
  • April 16, 2014

is there away to have a script run that would look for the version of office 2011 or 2008 with out having to have to different scripts?


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • April 16, 2014

Not tested at all, but I think this should work-

#!/bin/sh

if [ -d /Applications/Microsoft Office 2011 ] ; then
    RESULT=$( defaults read /Applications/Microsoft Office 2011/Office/MicrosoftComponentPlugin.framework/Versions/14/Resources/Info CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
elif [ -d /Applications/Microsoft Office 2008 ] ; then
    RESULT=$( defaults read /Applications/Microsoft Office 2008/Office/MicrosoftComponentPlugin.framework/Versions/12/Resources/Info CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
else
    echo "<result>Not Installed</result>"
fi

Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • March 30, 2017

Here is one that will look for version of Outlook in MS Office 2008, 2011 and 2016 for Mac:

#!/bin/sh
if [ -d /Applications/Microsoft Office 2011/Microsoft Outlook.app ] ; then
    RESULT=$( sudo defaults read /Applications/Microsoft Office 2011/Microsoft Outlook.app/Contents/Info.plist CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
elif [ -d /Applications/Microsoft Office 2008/Microsoft Outlook.app ] ; then
    RESULT=$( sudo defaults read /Applications/Microsoft Office 2008/Microsoft Outlook.app/Contents/Info.plist CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
elif [ -d /Applications/Microsoft Outlook.app ] ; then
    RESULT=$( sudo defaults read /Applications/Microsoft Outlook.app/Contents/Info.plist CFBundleShortVersionString )
    echo "<result>$RESULT</result>"
else
    echo "<result>Not Installed</result>"
fi

Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • March 31, 2017

You can also use Spotlight if it is enabled, which is pretty fast.

#!/bin/bash

# get Microsoft app versions

for app in /Applications/Microsoft* ; do
  appname="$(mdls -name "kMDItemFSName" "${app}" | awk '{$1=$2=""; print $0}')"
  appvers="$(mdls -name "kMDItemVersion" "${app}" | awk '{print $3}')"
  echo "<result>${appname} ${appvers}</result>"
done

sample output:

<result>  "Microsoft Excel.app" "15.19.1"</result>
<result>  "Microsoft PowerPoint.app" "15.19.1"</result>
<result>  "Microsoft Word.app" "15.19.1"</result>

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings