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.
This file contains 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
|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|
|"/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"|