Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for Jamf Self Service to change the username field of the current user's Outlook Exchange account to the email address. Useful when migrating from on-prem Exchange server to Office 365.
#!/bin/sh
currentUser="$3"
su "$currentUser" -c /usr/bin/osascript << 'OUTLOOKCOMMAND'
tell application "Microsoft Outlook"
set emailAddress to email address of exchange account 1
set user name of exchange account 1 to emailAddress
end tell
OUTLOOKCOMMAND
"/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action" -message "Your Microsoft Outlook account has been updated for Office 365." -title "Outlook Update Complete"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment