Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created October 28, 2017 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talkingmoose/d96d5885c38b6228e1999861b7be0839 to your computer and use it in GitHub Desktop.
Save talkingmoose/d96d5885c38b6228e1999861b7be0839 to your computer and use it in GitHub Desktop.
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