Outlook 2016 autoconfigure

hkabik
Valued Contributor

Now that the schedules tab is removed from Outlook's preferences... has anyone figure out a way to apply a self configuration script like this one?

https://github.com/talkingmoose/Outlook-Exchange-Setup

Our users really enjoyed everything being automagically configured.

1 ACCEPTED SOLUTION

talkingmoose
Moderator
Moderator

More stuff ready for anyone who'd like to test...

I've devised a launchd setup that works well for me in my testing to automatically configure Outlook 2016 the first time it's launched. After a lot of research into launchd QueueDirectories and WatchPaths, the WatchPaths made the most sense because I can monitor for the existence of specific files. (Thanks, @eholtam, for your ideas. I adapted them for my own changes.)

The whole setup consists of one LaunchAgent file and two scripts. The only file you need to customize is the AppleScript. Everything else can just drop in place. The ROOT folder simply designates the "root" of the hard drive or "/". For now, be sure to keep the names and paths of the files and folders the same as I've created them unless you're comfortable changing the references in the three files.

I've also made minor changes to the AppleScript itself to better accommodate all potential settings not just Active Directory as well as accommodate this new setup.

You'll find everything here: https://github.com/talkingmoose/Outlook-Exchange-Setup-5.0

Click the Download ZIP button to the bottom right and locate these files in the ROOT folder:

  • /Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist
  • /Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.0.scpt (customize this)
  • /Library/Talking Moose Industries/Scripts/OutlookExchangeLaunchAgent.sh

Feedback, as always, is greatly appreciated.

View solution in original post

220 REPLIES 220

wmateo
Contributor

@talkingmoose how do you handle signatures? we want our users to have and image, and text similar how Windows handles. Signature templates

Look
Valued Contributor III

@wmateo Not sure how others have doen this...
We did it by having an HTML template signature and associated images with unique tags that we replaced with data pulled from AD (name, email, phone number, title, etc..), we then used an Applescript call to Outlook to create a new signature using this template.
Unfortunately I am now off work until after the new year so can't easily check the scripting for you.

wmateo
Contributor

@Look Since our AD enviroment is not really cleaned up yet. I was looking for a way to "prefill" the Signature area with a few default images, and dummy fields so user can enter name themselves.

Look
Valued Contributor III

Well you can definately make an Applescript call to Outlook 2016 and tell it to create a new signature using an HTML file as the source, if you have any linked image files in the same directory and in the right format (png I think is what I used) then it will embed these in the signature as wel, this is new behaviour as of a fairly recent version upgrade, previously it just linked images, which sucked.
Not quite sure how the best way to go about creating the HTML signature, ours was originally supplied to me by branding, it was massively over complicated so I pulled it apart and rebuilt it with half the code, but it did mean it had all the correct stuff specified at the top, maybe you can export it in HTML from Windows or something, not sure.

kbach
New Contributor

@talkingmoose Thoughts on updating an existing Outlook 2016 account with a new directory service server name? Something like this?

tell application "Microsoft Outlook"
try set ldap server:xxxxxxxxxxx
end try
end tell

talkingmoose
Moderator
Moderator

@kbach, the syntax is close. You also need to specify the account. You may also want to set the other properties of the LDAP server (just to be thorough). I think the "try" statement is a good idea. Give this a shot:

tell application "Microsoft Outlook"
    try
        set ldap server of exchange account 1 to "ldap.company.com"
        set ldap needs authentication of exchange account 1 to true
        set ldap use ssl of exchange account 1 to true
        set ldap port of exchange account 1 to 3269
        set ldap max entries of exchange account 1 to 1000

        -- rarely need to set this, but would be something like "CN=Users,DC=talkingmoose,DC=net"
        set ldap search base of exchange account 1 to ""
    end try
end tell

Optionally, you can replace the "1" in exchange account 1 with the Account Description if you want to call it by name:

set ldap server of exchange account "My Exchange Account" to "ldap.company.com"

AppleScript is pretty much the only way to set these attributes. It will require Outlook be running or it will launch Outlook automatically if it's not running. This probably isn't something you want to just spring on your users.

kbach
New Contributor

@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.

jonlju
Contributor

@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.

dpratl
Contributor II

@jonlju

Try to download it again, I once had that too and redownloading solved it for me.

BR
Daniel

jonlju
Contributor

@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.

talkingmoose
Moderator
Moderator

@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).

OneSeventeen
New Contributor II

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.

talkingmoose
Moderator
Moderator

@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.

OneSeventeen
New Contributor II

Awesome, thanks! I realize much of that was mentioned in the wiki, but I appreciate you spelling it out for me.

wmateo
Contributor

@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?

chad_fox
Contributor II

@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.

perweilerg
New Contributor III

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!

kstrick
Contributor III

@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.

BrentSlater
Release Candidate Programs Tester

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?

talkingmoose
Moderator
Moderator

@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?

BrentSlater
Release Candidate Programs Tester

Hey @talkingmoose I can't see any log file for it...

Definitely something is up there.

I will do some more digging

Aaron
Contributor II

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.

rqomsiya
Contributor III

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!

gbunner
New Contributor III

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 :)
4a5a9659b9f94ca589e38fb198acf80f

Thanks in advance!
Gene

talkingmoose
Moderator
Moderator

@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.

gbunner
New Contributor III

That worked perfectly, Thanks for your assistance!

MatG
Contributor III

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.

rqomsiya
Contributor III

easiest way I’ve found is to just delete the user profile you tested on. This way it will delete the group containers.

talkingmoose
Moderator
Moderator

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.

MusRM
New Contributor

@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.

talkingmoose
Moderator
Moderator

@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

gbunner
New Contributor III

Hello,
When a new user logs in and opens Outlook for the first time, the first window they see is the "Set Up Your Email" popup window and then a few seconds later they get the username and password box for the auto connect to happen (which is good!) The problem that I'm seeing is when a user is presented with the first "Set up Your Email" window, they go down that rabbit hole and Outlook doesn't auto configure and in a lot of cases, they hit cancel on the username/password box that pops up a few seconds later. My Question: Is there a way to disable the first "Set Up Your Email" window? this way they will only be presented with username/password dialog. Once we get that accomplished, then it's down to user training to go ahead and enter the password and not hit cancel.12ffabf86a7d40cf9235a56eb7ae1500

Thanks!

talkingmoose
Moderator
Moderator

@gbunner, see line 51 of this spreadsheet:

https://docs.google.com/spreadsheets/d/1ESX5td0y0OP3jdzZ-C2SItm-TUi-iA_bcHCBvaoCumw/edit#gid=0

Mac admins requested the ability to block the automatic setup and Microsoft responded by providing us this key/value pair.

To create a Configuration Profile in your Jamf Pro server:

  1. Create the plist with the setting (copy these two lines and paste into Terminal): /usr/bin/defaults write ~/Desktop/com.microsoft.Outlook.plist
    OverrideAccountConfigurationWindow -bool TRUE

  2. Convert the new plist on your Desktop from binary to a plain text XML file: /usr/bin/plutil -convert xml1 ~/Desktop/com.microsoft.Outlook.plist

  3. In your JSS, create a new Configuration Profile with a Custom payload. Upload the com.microsoft.Outlook.plist file and save.

You can download the Configuration Profile for testing on a local machine before deploying to your Macs.

boonkeatgan
New Contributor II

@talkingmoose Do you have deployment guide on how to use the script at https://github.com/talkingmoose/Oulook-Exchange-Setup-5.0?

I am quite new to Mac and Jamf.

Thank you!

talkingmoose
Moderator
Moderator

@boonkeatgan, I do! Check out the wiki just a few tabs to the right of the download page:

https://github.com/talkingmoose/Outlook-Exchange-Setup-5/wiki

boonkeatgan
New Contributor II

@talkingmoose Thank you so much!

boonkeatgan
New Contributor II

@talkingmoose First of all, thank you for the Script. It is amazing and working for me.

The only thing is when i deploy the mobile config, it will prompted on error unable to configure. When i remove the mobile config, it is working fine.

Any idea whats wrong with the mobileconfig portion?

talkingmoose
Moderator
Moderator

@boonkeatgan, the mobileconfig file is there for convenience. If you want to remove it from the Package/ROOT/tmp/Outlook Exchange Setup 5 folder before making your deployment package, everything will work just fine.

Eventually, you may want to suppress some of the Outlook first run windows. You can create a configuration profile in Jamf to do this and deploy it using Jamf. That's effectively the same thing as deploying the mobileconfig file in the package. Let's worry about whether you need to do that after you've removed the mobileconfig file and tested.

boonkeatgan
New Contributor II

@talkingmoose Thank you! we are ok with the first run.

I saw you posted the Lync (somewhere in 2012), do you happen to have Skype for Business version too?

talkingmoose
Moderator
Moderator

@boonkeatgan, nothing for Skype, unfortunately. It's not something I have experience managing. But someone did a really nice job documenting the manageable settings here:

https://techcommunity.microsoft.com/t5/Skype-for-Business-IT-Pro/Skype-for-Business-Mac-client-Prefe...