Skip to content

Instantly share code, notes, and snippets.

@technoluc
Created October 24, 2022 17:40
Show Gist options
  • Save technoluc/3723b7a13c195d3958eafa94a714f148 to your computer and use it in GitHub Desktop.
Save technoluc/3723b7a13c195d3958eafa94a714f148 to your computer and use it in GitHub Desktop.
mac_office

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

Activation Step

  1. DO NOT RUN OFFICE APP AFTER INSTALLED, but just install Office 2019 for macOS

    or install via brew:

    brew cask install microsoft-office
  2. manual download and install Microsoft_Office_2019_VL_Serializer.pkg

  3. run Microsoft_Office_2019_VL_Serializer and it will automatic activate Office 2019

  4. open the office app, completed.

Note

If you alaways been asked for 'Sign in' and still requires activation, please try to remove Office license files on a Mac. Here is the official download link for Microsoft_Office_License_Removal tool. (thanks for @lidroider's comment)

The Serializer.pkg in this gist is signature by Microsoft Corporation Official. To check it, you can see details in this comment

Office 2016 16.11 for macOS VL2 license

2018-04-25

Ref

Activation Step

  1. install Office2016 for mac with Office Suite Install, but DO NOT RUN OFFICE AFTER INSTALLED

    or install via brew:

    # brew cask install microsoft-office  # this point to Office 2019 now
    # install last office 2016 version below
    brew cask install https://github.com/Homebrew/homebrew-cask/raw/538c7cf34c085e3bb4fdac36f6370ded87930036/Casks/microsoft-office.rb
  2. copy license file com.microsoft.office.licensingV2.plist to Preferences

    # md5(com.microsoft.office.licensingV2.plist) = a8f1283303838b4d3bd943775e463239
    cp com.microsoft.office.licensingV2.plist /Library/Preferences/
    
    # or download it in library by command line
    curl -sSL git.io/office16-plist -o /Library/Preferences/com.microsoft.office.licensingV2.plist
  3. run the office app, completed.

#!/bin/zsh
:<<'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 20, 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 optionally update the sha256Checksum
value with a known SHA 256 string. Run the script with elevated
privileges. If using Jamf Pro, consider replacing the linkID and
sha256Checksum values with "$4" and "$5", entering the ID as script
parameters 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 (Consumer Stable)
# 2069439 - Edge (Consumer Beta)
# 2069340 - Edge (Consumer Dev)
# 2069147 - Edge (Consumer Canary)
# 2093438 - Edge (Enterprise Stable)
# 2093294 - Edge (Enterprise Beta)
# 2093292 - Edge (Enterprise Dev)
# 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
# enter the SHA 256 checksum for the download file
# download the package and run '/usr/bin/shasum -a 256 /path/to/file.pkg'
# this will change with each version
# leave blank to to skip the checksum verification (less secure) or if using a $5 script parameter with Jamf Pro
sha256Checksum="" # e.g. "67b1e8e036c575782b1c9188dd48fa94d9eabcb81947c8632fd4acac7b01644b"
if [ "$4" != "" ] && [ "$linkID" = "" ]
then
linkID=$4
fi
if [ "$5" != "" ] && [ "$sha256Checksum" = "" ]
then
sha256Checksum=$5
fi
# this is the full fwlink URL
url="https://go.microsoft.com/fwlink/?linkid=$linkID"
# create temporary working directory
echo "Creating working directory '$tempDirectory'"
workDirectory=$( /usr/bin/basename $0 )
tempDirectory=$( /usr/bin/mktemp -d "/private/tmp/$workDirectory.XXXXXX" )
# change directory to temporary working directory
echo "Changing directory to working directory '$tempDirectory'"
cd "$tempDirectory"
# download the installer package and name it for the linkID
echo "Downloading package $linkID.pkg"
/usr/bin/curl --location --silent "$url" -o "$linkID.pkg"
# checksum the download
downloadChecksum=$( /usr/bin/shasum -a 256 "$tempDirectory/$linkID.pkg" | /usr/bin/awk '{ print $1 }' )
echo "Checksum for downloaded package: $downloadChecksum"
# install the package if checksum validates
if [ "$sha256Checksum" = "$downloadChecksum" ] || [ "$sha256Checksum" = "" ]; then
echo "Checksum verified. Installing package $linkID.pkg"
/usr/sbin/installer -pkg "$linkID.pkg" -target /
exitCode=0
else
echo "Checksum failed. Recalculate the SHA 256 checksum and try again. Or download may not be valid."
exitCode=1
fi
# remove the temporary working directory when done
/bin/rm -Rf "$tempDirectory"
echo "Deleting working directory '$tempDirectory' and its contents"
exit $exitCode
#!/bin/bash
# witness the horror
# seriously don't do this
# last warning.. maybe
# Guess I'm putting a license in
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
# Not intended for prod ¯\_(ツ)_/¯
DOWNLOAD_URLS=( \
# Outlook
"https://go.microsoft.com/fwlink/?linkid=525137" \
# Word
"https://go.microsoft.com/fwlink/?linkid=525134" \
# Excel
"https://go.microsoft.com/fwlink/?linkid=525135" \
# Powerpoint
"https://go.microsoft.com/fwlink/?linkid=525136" \
# Autoupdater - comment download url below to skip install
"https://go.microsoft.com/fwlink/?linkid=830196" \
# OneNote - uncomment download url to install
# "http://go.microsoft.com/fwlink/?linkid=820886" \
)
MAU_APP_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app"
DOUBLE_SECRET_MAU_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"
INSTALLER_TARGET="LocalSystem"
for downloadUrl in "${DOWNLOAD_URLS[@]}"; do
finalDownloadUrl=$(curl "$downloadUrl" -s -L -I -o /dev/null -w '%{url_effective}')
pkgName=$(printf "%s" "${finalDownloadUrl[@]}" | sed 's@.*/@@')
pkgPath="/tmp/$pkgName"
printf "Downloading %s\n" "$pkgName"
curl --retry 3 -L "$finalDownloadUrl" -o "$pkgPath"
curlExitCode=$?
if [ "$curlExitCode" -ne 0 ]; then
printf "Failed to download: %s\n" "$downloadUrl"
printf "Curl exit code: %s\n" "$curlExitCode"
else
printf "Installing %s\n" "$pkgName"
installer -pkg "$pkgPath" -target "$INSTALLER_TARGET" -verbose
installerExitCode=$?
if [ "$installerExitCode" -ne 0 ]; then
printf "Failed to install: %s\n" "$pkgPath"
printf "Installer exit code: %s\n" "$installerExitCode"
fi
rm "$pkgPath"
fi
done
# This part borrowed from https://gist.github.com/erikng/7cede5be1c0ae2f85435
if [ -e "$MAU_APP_PATH" ]; then
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "$MAU_APP_PATH"
if [ -e "$DOUBLE_SECRET_MAU_PATH" ]; then
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "$DOUBLE_SECRET_MAU_PATH"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment