Passing AD Credentials to Microsoft Outlook 2016

al786
New Contributor III

Hello,
We have AD bound Macs and are using Office 365 (So the email address is first.last@university.edu and NOT UniversityID@universitu.edu)

I've been trying to use :

https://github.com/talkingmoose/Outlook-Exchange-Setup-5 by @talkingmoose But it doesn't seem to do anything except bypass the initial Outlook start up. Has anyone had any experience with the script?

I usually image the machine with a stock 10.13.3 then I join it to Jamf using quick add.pkg which then installs our volume licensed Office 2016 package then I compiled a .PKG as per the wiki.

Was my mistake installing office first or could it be somewhere else?

1 ACCEPTED SOLUTION

talkingmoose
Moderator
Moderator

@al786, thanks for using the updated script. It helps me see how far the script is progressing.

Your log from March 8 showed this alert: Folder "/Users/law/Library/Group Containers/UBF8T346G9.Office" does not exist. Your new log shows a different user and that the script is getting further.

Looks like everything up to gathering user information is working. I'll need to dive lower down in the setup and see if I can spot a place to add more logging. This may take a few days to get something else ready.

View solution in original post

27 REPLIES 27

talkingmoose
Moderator
Moderator

@al786, sounds like the script is failing to run if Outlook opens but the account doesn't appear.

Some things to check:

  1. Deploy the setup package to a Mac and then log in as a test user. Don't launch Outlook and test under a new (clean) macOS account.
  2. Do you see the scripts installed in "/Library/Talking Moose Industries" or your own folder name if you've renamed it?
  3. Do you see the "/Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist" file?
  4. In the current user's home folder, do you see the "~/Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetup5.plist" file?
  5. In the current user's home folder, do you see the "~/Library/Logs/OutlookExchangeSetup5.log" file?

All of these should be in place prior to Outlook running. If they are, then we can move on to troubleshooting the script with Outlook. If not, we need to troubleshoot the deployment.

al786
New Contributor III

@talkingmoose Thanks for the response!!

I did all these steps - 2,3,4,5 the answer is yes..the only thing I noticed that the permissions for the "Talking Moose" folder, the .plist, are for the admin user only not the test user. Should it be set to read/write for everyone? Other than that, not quite sure.

talkingmoose
Moderator
Moderator

@al786, as long as the current user has permissions to read the files in the Talking Moose Industries folder, that's all that's needed. I think we're OK there.

So, all the pieces are in place for the script to run the first time Outlook gets launched. Now, launch Outlook and give it a few seconds to run. Once you see the Outlook window, it should almost immediately prompt for credentials.

  1. Is this a local Exchange server or Office 365?
  2. Under the Outlook menu, is Outlook set to Work Offline?
  3. Under Outlook menu > Preferences > Accounts, do you see any account partially or fully configured?
  4. Do the last few lines of the log file indicate what may be happening or what step failed? Check "~/Library/Logs/OutlookExchangeSetup5.log".

al786
New Contributor III
  1. it's office 365
  2. set to work online
  3. no accounts - says "Add account"
  4. I've attached the .scpt and also the .log (I'm sure you're slammed but hopefully you can spot my likely foolish mistakes)

https://uploadfiles.io/jnla1
https://ufile.io/cov8w

Thanks!
@talkingmoose

talkingmoose
Moderator
Moderator

I need to write some error handling here, but I'll ask, "Is the 'law' user account a real AD account?"

Run the following in Terminal while logged in as this test user account and let me know the results:

/usr/bin/dscl /Search -read "/Users/law" AuthenticationAuthority City co company department physicalDeliveryOfficeName sAMAccountName wWWHomePage mail FAXNumber FirstName JobTitle LastName MobileNumber PhoneNumber PostalCode RealName State Street

talkingmoose
Moderator
Moderator

@al786, in addition to my request above about the account, I've also updated the script with some more logging and reverted a change made a few months back that may be causing issues.

Please download the 5.5.3 version of the scripts and test when you can.

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

al786
New Contributor III

@talkingmoose Strange, I don't get an output in terminal when I do this, "law" isn't a real AD account. - is that written somewhere?

https://ufile.io/yn9py

is the new log (just removed some of the more personal details since this is public)

Thanks again, I ended up grabbing a new machine and going through the instructions again but got the same result on the "Test" - Outlook opens, bypassing the "setup" but still no accounts partially configured under "tools".

talkingmoose
Moderator
Moderator

@al786, thanks for using the updated script. It helps me see how far the script is progressing.

Your log from March 8 showed this alert: Folder "/Users/law/Library/Group Containers/UBF8T346G9.Office" does not exist. Your new log shows a different user and that the script is getting further.

Looks like everything up to gathering user information is working. I'll need to dive lower down in the setup and see if I can spot a place to add more logging. This may take a few days to get something else ready.

al786
New Contributor III

@talkingmoose That's totally fine, thanks for even checking! Honestly with how little gets passed through AD binding I think at this point I'd be happy with when users click on Outlook if it just asked popped up asking for a password instead of them having to go to Tools > Add > Account etc..

talkingmoose
Moderator
Moderator

@al786, I've looked over the part of the script that seems to be failing and think I've found the issue. Please download the latest release and test. Let me know what you find.

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

al786
New Contributor III

@talkingmoose So im going to try ti again tomorrow but this time I definitely had an account created, it was ShortID@University.edu instead of first.last@yale.edu but that's likely a problem with my setup in the initial apple script correct? Anyway, upon first opening Outlook it prompted for my password to that account so definitely a big step!

talkingmoose
Moderator
Moderator

@al786, excellent! Sounds like the script is working.

There is this setting near the top. It may be what you need. You would set it to true.

--------------- For Office 365 users ---------------------

property useEmailForUsername : false
-- Office 365 and similar mail services may require the username to be the same
-- as the email address. Set this to true if the username is the same as the
-- email address.

jonathan_massey
New Contributor III

I'm seeing the same behavior as the original poster, but I am 99% certain that it is user error on my end, I just don't know where that error lies. I'm thinking that for some reason the Launch Agent isn't giving the script the kick in the pants that it needs to get going. What is the best way for me to figure this out?

talkingmoose
Moderator
Moderator

@jonathan.massey, have you tried any of the suggestions given the original poster? What are the results of your testing?

Also, if you haven't read the wiki, it may help:

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

jonathan_massey
New Contributor III

I have gone through the steps in the Wiki and it works perfect from the computer that I test on. However, when I run it from a created package on a clean computer it just sits there. Does that make sense?

talkingmoose
Moderator
Moderator

Are all the files getting deployed to their respective locations and have you possibly changed the names of any of them?

jonathan_massey
New Contributor III

As far as I know the files are all in the locations that the wiki says they need to be. However, I noticed in your comment above that the location of some of the files were " ~/Library " as opposed to just "/Library".

Mine are all located in "/Library"

jonathan_massey
New Contributor III

Also, I'm not seeing the log file you mentioned.

talkingmoose
Moderator
Moderator

On your test Mac, can you run the following four lines (one at a time) in Terminal for me? Nothing from the results should contain anything confidential. This will help me verify your files are in the correct places and permissions are also correct.

ls -hal /Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist
ls -hal /Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.5.4.scpt
ls -hal /Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh

cat /Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist

jonathan_massey
New Contributor III
-rwxr-xr-x  1 jonathan.massey  BELTONDomain Users   1.5K Mar 17 16:46 /Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist
jonathan.massey$ ls -hal /Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.5.4.scpt
ls: /Library/Talking: No such file or directory
ls: 5.5.4.scpt: No such file or directory
ls: Exchange: No such file or directory
ls: Industries/Scripts/Outlook: No such file or directory
ls: Moose: No such file or directory
ls: Setup: No such file or directory
jonathan.massey$ ls -hal /Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh
ls: /Library/Talking: No such file or directory
ls: Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh: No such file or directory
ls: Moose: No such file or directory
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

<!--
Outlook Exchange Setup 5
© Copyright 2008-2018 William Smith
bill@talkingmoose.net

Except where otherwise noted, this work is licensed under
http://creativecommons.org/licenses/by/4.0/

This file is one of four files for assisting a user with configuring
an Exchange account in Microsoft Outlook 2016 for Mac:


1yFAv38RrG8gyYcrT2vp

These scripts and files may be freely modified for personal or commercial
purposes but may not be republished for profit without prior consent.

If you find these resources useful or have ideas for improving them,
please let me know. It is only compatible with Outlook 2016 for Mac.
-->

<dict>
    <key>Disabled</key>
    <false/>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/sbin</string>
    </dict>
    <key>Label</key>
    <string>net.talkingmoose.OutlookExchangeSetupLaunchAgent</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/sh</string>
        <string>/Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

talkingmoose
Moderator
Moderator

OK, let's try those first three again. I've quoted the paths.

ls -hal '/Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist'
ls -hal '/Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.5.4.scpt'
ls -hal '/Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh'

The last result looks as expected.

jonathan_massey
New Contributor III
OUTLOOK-TEST:~ jonathan.massey$ ls -hal '/Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist'
-rwxr-xr-x  1 jonathan.massey  BELTONDomain Users   1.5K Mar 17 16:46 /Library/LaunchAgents/net.talkingmoose.OutlookExchangeSetupLaunchAgent.plist
OUTLOOK-TEST:~ jonathan.massey$ ls -hal '/Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.5.4.scpt'
-rwxr-xr-x@ 1 jonathan.massey  wheel   128K May  9 15:57 /Library/Talking Moose Industries/Scripts/Outlook Exchange Setup 5.5.4.scpt
OUTLOOK-TEST:~ jonathan.massey$ ls -hal '/Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh'
-rwxr-xr-x  1 jonathan.massey  wheel   5.1K Mar 17 16:46 /Library/Talking Moose Industries/Scripts/OutlookExchangeSetupLaunchAgent.sh

talkingmoose
Moderator
Moderator

@jonathan.massey, are you packaging the items and then running the package on your test Mac? Everything appears to be owned by you, but the postinstall script in the package should take care of all that.

https://github.com/talkingmoose/Outlook-Exchange-Setup-5/wiki/Run-the-Package-for-Deployment-app

jonathan_massey
New Contributor III

Yes, I'm packaging it and installing via policy through JAMF.

jonathan_massey
New Contributor III

So, I just ran through the setup again, created a package and installed it on a new machine. However, when the Setup package deployed it did not copy the launch agent, only the Talking Moose folder containing the scripts.

talkingmoose
Moderator
Moderator

Hmm... That's not making sense. The installer is Apple's technology. What's the specific method you're using to create the package?

If you're using the command line method, be sure you're running the full commands. GitHub's code display truncates the lines:

packageName="Outlook Exchange Setup 5"
packageIdentifier="net.talkingmoose.OutlookExchangeSetup5"
packageVersion="1.0.0"

folderPath=$( dirname '/path/to/ROOT' ) # fill this path by dragging and dropping the ROOT folder from this project's folder here
find "$folderPath" -name .DS_Store -delete

pkgbuild --identifier "$packageIdentifier" --version "$packageVersion" --scripts "$folderPath/Scripts" --root "$folderPath/ROOT" "$folderPath/$packageName.pkg"

jonathan_massey
New Contributor III

I'm using the Package for Deployment app found in the Outlook Exchange Setup folder.