@talkingmoose This worked perfectly, thanks!
!/usr/bin/osascript
tell application "Microsoft Outlook"
try
set ldap server of exchange account 1 to "xxxxx.xxxxx.com"
end try
end tell
Created the script, attached to policy with a trigger of a login hook..update successful.
@talkingmoose I've never gotten this to work...whenever I run the "Package for deployment" it says "Package build failed. Verify ROOT and Scripts folders are in the same folder as this Package for Deployment app." Any idea what I'm doing wrong? I didn't change the folder structure of the download, running on 10.12.3.
@jonlju
Try to download it again, I once had that too and redownloading solved it for me.
BR
Daniel
@dpratl Thank you, I tried that too but no dice unfortunately. Also tried a different Mac (but it also runs 10.12.3) and I get the same issue.
@jonlju, I'm seeing similar behavior and will look into it. I suspect this is sandboxing getting more and more strict.
In the meantime, it seems to work just fine if you open the Package for Deployment.app file in Script Editor (located in /Applications/Utilities) and run it from there. Just click the third button (Play button).
I'm very new to this, so I'm sorry if this is obvious:
How do I prevent the package from suppressing the first run windows? Our staff are licensed through O365 and I'd like them to see the first run windows so they have an opportunity to activate Office when launching Outlook (which is usually the first Office app they launch).
Based on what I've seen in the scripts, it feels as though removing the .mobileconfig file from the package should be enough, but I wanted to make sure there wasn't a better method.
Thanks again to everyone on the hard work for this! As I learn more about packages and AppleScript I hope to contribute more myself.
@OneSeventeen, the default Microsoft_Outlook_2016_First_Run.mobileconfig profile included with the package includes three keys. The combination of all three keys suppresses every first run dialog.
For Office 365 users, locate the com.microsoft.Outlook.plist file in the Extras folder. Open this plist file with a text editor such as TextWrangler, Xcode or TextEdit. Delete the kSubUIAppCompletedFirstRunSetup1507 key and the value below it. Save the file.
In your JSS, create a new Configuration Profile and choose the Custom Setting payload. Upload your edited plist file and save.
You can either download this Configuration Profile to make a new .mobileconfig profile that replaces the original in the ROOT > tmp folder or remove the original altogether and use Jamf to deploy the configuration profile.
Removing this one key will allow Office 365 users to activate Office but will suppress the Outlook setup dialog and let the script run.
Awesome, thanks! I realize much of that was mentioned in the wiki, but I appreciate you spelling it out for me.
@Look if you could forward me your script, that would be great. I would love to implement this in our org. Any way to also mass delete existing signatures?
@wmateo This works via Apple Script, I tested it now:
tell application "Microsoft Outlook"
delete signature 1
end tell
Just replace the 1 with whatever signature you're trying to remove.
Thanks for the script! My question is a bit off topic, but you sound like a very knowledgable group.
What ideas does anyone have for migrating On My Computer archives to Online Archives? We used an Entourage script and then OEAO to archive from Exchange to On My Computer.
Now that we are moving to 2016 with Online Archives we are trying to get the archives moved to the new Online Archives, but it appears you can only move (copy) one message at a time directly there, or move the messages back to the main account. The problem is we have users with huge archives that won't fit into their small exchange account and users with hundreds of folders that would each have to be manually moved.
I am hoping someone has done this before without too much pain. Thanks!
@perweilerg RE: Online Archiving
The Mac Outlook options are not good, due to limitations with MS's EWS API.
There is a mac version of Quadrotech's Flightdeck being developed for mac, but it's still only beta quality (we are having issues getting it to work right).
Every other option i've found so far is pretty painful.
Hi Guys,
We have this script in place for our Office 365 Instance an for the most part it works great, with the exception that it is running everytime that Outlook gets opened rather than just the first time.
I was not the person that initiated the script setup but it is just downright annoying for users now because they click on the Verify button all the time and create multiple exchange accounts taking up a huge amount of space.
any ideas?
@BrentSlater, the script triggers using a launch agent in the current user's ~/Library/LaunchAgents folder. After successful setup, that launch agent is supposed to get deleted and not run again. Sounds like that's not happening.
Run this on a clean machine if you can and reproduce the problem. The script creates a log in the user's ~/Library/Logs folder. Does it indicate anything is failing?
Hey @talkingmoose I can't see any log file for it...
Definitely something is up there.
I will do some more digging
I'm getting this too actually, the error that comes back is:
Delete OutlookExchangeSetup5.plist file from user LaunchAgents folder: Failed.
Unload OutlookExchangeServer5.plist launch agent: Failed.
Will also do some digging.
Edit: Worked it out almost as soon as I posted this.
Some of my usernames have spaces in it - we're moving away from this, but there are still some users (me included) that have spaces.
I had to edit one of the lines to quote around the $HOME variable. Right down the bottom:
do shell script "/bin/rm "$HOME/Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetup5.plist""
Note the escaped quotes.
Hi all,
Having issues getting Outlook 15.38 to autoconfigure with @talkingmoose's configuration script. I get the following error in AppleScript when i manually run the .scpt:
error "The variable emailAddress is not defined." number -2753 from "emailAddress"
Any input would be greatly appreciated! Thanks!
Hello All,
I'm happy that I seem to have everything working as expected. The last piece to the puzzle for me would be to figure out how to deal with the verify certificate popup to make this truly a seamless process for the end user. I'm currently using a configuration profile to deliver the .cer certificate payload. it's currently set to install automatically at the computer level. It does show up in the Keychain after selecting "Always Trust". When Outlook 2016 is launched for the first time, I'm getting the following verify certificate popup. Is there a way to make this box happy so that it doesn't appear on first run? Last piece to the puzzle, so close :)

Thanks in advance!
Gene
@gbunner, it appears the .cer file you uploaded is not a copy of the root certificate used to sign your mail server's certificate. Deploy the .cer that signed your server's certificate in a configuration profile. It will be trusted on the Macs automatically. Any certificates you encounter as part of connecting to a server will be trusted because you'll have already trusted the root.
That worked perfectly, Thanks for your assistance!
Is there an easy way to set everything back to default as my first attempt at this after activating O365 I just got the first run screens.
easiest way I’ve found is to just delete the user profile you tested on. This way it will delete the group containers.
I'll agree with @rqomsiya. For something like this, a test macOS user account is ideal. No chance of cruft from earlier testing getting in the way and Fast User Switching or a virtual machine makes this easy to do.
I've worked with few folks directly to try and delete all the necessary folders and files for a reset. It's easy to forget something.
@talkingmoose Thank you for all your hard work so far! I have used some of the scripts that you put together to get rid of Outlook's first run and welcome windows.
I am trying to set the Outlook authentication method to Kerberos instead of the regular User Name and Password. I just want the option to be pre-defined/pre-selected Kerberos, so that the users just input their email address. Note that we have Autodiscover feature in Exchange.
Can we acheieve that with a .sh or .scpt file?
Appreciate your help.
@MusRM, if you're using my Outlook Exchange Setup script, one of the properties you can set at the top of the AppleScript is to use Kerberos. The syntax looks something like:
tell application "Microsoft Outlook"
set use kerberos authentication of exchange account 1 to true
set principal of exchange account 1 to "mmoose@talkingmoose.pvt"
end tell