Last active
July 29, 2025 23:30
-
-
Save talkingmoose/a16ca849416ce5ce89316bacd75fc91a to your computer and use it in GitHub Desktop.
**Download the latest version of this script from: https://gist.github.com/b6637160b65b751824943ede022daa17 .** Downloads and installs the latest available Microsoft product specified directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
<<ABOUT_THIS_SCRIPT | |
----------------------------------------------------------------------- | |
Written by:William Smith | |
Professional Services Engineer | |
Jamf | |
[email protected] | |
https://gist.github.com/talkingmoose/a16ca849416ce5ce89316bacd75fc91a | |
Originally posted: November 19, 2017 | |
Updated: January 15, 2020 | |
Purpose: Downloads and installs the latest available Microsoft | |
product specified directly on the client. This avoids having to | |
manually download and store an up-to-date installer on a | |
distribution server every month. | |
Instructions: Update the linkID value to one of the corresponding | |
Microsoft products in the list and run the script with elevated | |
privileges. If using Jamf Pro, consider replacing the linkID value | |
with "$4" and entering the ID as a script parameter in a policy. | |
Except where otherwise noted, this work is licensed under | |
http://creativecommons.org/licenses/by/4.0/ | |
"You say goodbye and I say exit 0." | |
----------------------------------------------------------------------- | |
ABOUT_THIS_SCRIPT | |
# enter the Microsoft fwlink (permalink) product ID | |
# or leave blank if using a $4 script parameter with Jamf Pro | |
linkID="" # e.g. "525133" for Office 2019 | |
# 525133 - Office 2019 for Mac SKUless download (aka Office 365) | |
# 2009112 - Office 2019 for Mac BusinessPro SKUless download (aka Office 365 with Teams) | |
# 871743 - Office 2016 for Mac SKUless download | |
# 830196 - AutoUpdate download | |
# 2069148 - Edge (Stable) | |
# 2069439 - Edge (Beta) | |
# 2069340 - Edge (Dev) | |
# 2069147 - Edge (Canary) | |
# 525135 - Excel 2019 SKUless download | |
# 871750 - Excel 2016 SKUless download | |
# 869655 - InTune Company Portal download | |
# 823060 - OneDrive download | |
# 820886 - OneNote download | |
# 525137 - Outlook 2019 SKUless download | |
# 871753 - Outlook 2016 SKUless download | |
# 525136 - PowerPoint 2019 SKUless download | |
# 871751 - PowerPoint 2016 SKUless download | |
# 868963 - Remote Desktop | |
# 800050 - SharePoint Plugin download | |
# 832978 - Skype for Business download | |
# 869428 - Teams | |
# 525134 - Word 2019 SKUless download | |
# 871748 - Word 2016 SKUless download | |
if [ "$4" != "" ] && [ "$linkID" = "" ] | |
then | |
linkID=$4 | |
fi | |
# this is the full fwlink URL | |
url="https://go.microsoft.com/fwlink/?linkid=$linkID" | |
# change directory to /private/tmp to make this the working directory | |
cd /private/tmp/ | |
# download the installer package and name it for the linkID | |
/usr/bin/curl -JL "$url" -o "$linkID.pkg" | |
# install the package | |
/usr/sbin/installer -pkg "$linkID.pkg" -target / | |
# remove the installer package when done | |
/bin/rm -f "$linkID.pkg" | |
exit 0 |
Comments are disabled for this gist.