OT - Officeformachelp.com - Outlook setup script

ImAMacGuy
Valued Contributor II

I saw others post links to the http://www.officeformachelp.com/ page, so I'm hoping that someone has gone through this already :)

I followed their deployment guide (with your help to fill in the confusing bits) for Outlook 2011, and everything is working fine except the outlook setup script 4.0.1. The instructions suggested to use it ((and I agree (huge inconsistency with how entourage was setup, depending on who trained the deployment tech's - determined if entourage was setup correctly or the end user had to open a ticket to get it fixed - and no amount of re-training seemed to help)) but I can't figure out how to get it to launch while using the scripted method of install of Outlook. I have the script configured, but the welcome screen comes up prompting for F-Name, L-Name and Company... then prompts normally for setting up the exchange account.

So I looked at the instructions in the Admin's guide that was included with the script and it shows I need to tell outlook in offline mode, create schedules, and something about user templates... but none of that was gone over in the original guide...

Any suggestions or is there a better way to do it?

27 REPLIES 27

jarednichols
Honored Contributor

So setting up Outlook in offline mode, setting up the schedules to run that script are all part of that deployment engineering process. You're basically setting up a "dummy" or first run Microsoft User Data folder that you'll deploy into the User's folder (FEU/FUT!). When the user launches Outlook for the first time, because you're pre-populated their schedules (one of which is to run that startup script) it then works.

ImAMacGuy
Valued Contributor II

I guess I understand that, but in doing the 'scripted' method, it doens't talk about how to setup the dummy account or anything in the g.... Oh wait, unless you mean deploy it to a test box, create the dummy folder per the script's admin pdf thing, then put that into the Office2011 Preferences file I created?

That actually makes a bit of sense.

carlo_anselmi
Contributor III

There's another interesting page here regarding Office 2011 setup
http://osxdeployment.com/wiki/Office_2011_Settings

So far I have been using it as provided (at "user template" level without integrating them into Casper at all). Very effective to auto populate "username" and "company" with dscl/AD but here the below script does not seem to work with 10.7.x

Any hint would be very appreciated
Cheers
Carlo

#!/bin/bash
username=$(whoami)
firstname=$(dscl /Active Directory/All Domains/ -read /Users/$username FirstName | awk ' NR=1 {print $2}')
lastname=$(dscl /Active Directory/All Domains/ -read /Users/$username LastName | awk ' NR=1 {print $2}')

/usr/libexec/PlistBuddy -c "Set :14\UserInfo\UserName '$firstname $lastname'" ~/Library/Preferences/com.microsoft.office.plist
/usr/libexec/PlistBuddy -c "Set :14\UserInfo\UserOrganization 'Companyname'" ~/Library/Preferences/com.microsoft.office.plist

talkingmoose
Moderator
Moderator
Oh wait, unless you mean deploy it to a test box, create the dummy folder per the script's admin pdf thing, then put that into the Office2011 Preferences file I created?

I think you've got the idea. Here's the problem that the "template" or "dummy" identity is trying to solve for Outlook (and earlier versions for Entourage):

  1. You cannot script Outlook using anything other than AppleScript.
  2. In order to use AppleScript Outlook must be running.
  3. The idea is to run the script automatically the first time Outlook is launched. This is handled using Outlook's Schedules feature, which can run a script at Startup.
  4. The only way to get the script into a user's Outlook identity is to provide him the identity in the first place. This is the "template" or "dummy" identity that you create following the instructions in the guide. You'll deploy this dummy identity to existing user accounts as well as into the Mac OS X User Template folder for any future users.
  5. While you're in the middle of creating the dummy identity you also have the opportunity to set preferences that you can't script like Rules. These become the default preferences for new Outlook users.
  6. Once Outlook is launched and the schedule runs the AppleScript then the script handles gathering information from the Mac (user name, etc.) and proceeds to configure the user's account. At the end it deletes the schedule that triggered it in the first place so that it doesn't run anymore.

You don't really need to use a test box to create the template identity. A different Mac OS X user account on your own machine should work fine. The second AppleScript included with the primary script is there to help you put your files in place for testing that everything works and will also gather your file together for you to package for deployment.

Feel free to ask me questions here or privately. I'm glad to help anyone get his environment configured. ( I wrote the scripts. :-D )

ImAMacGuy
Valued Contributor II

Oh, awesome! Okay, sorry I didnt get back to you yesterday, I managed to jack up my install and had to re-create everything from scratch again (I somehow managed to delete my final copy of everything - so I couldn't restore it easily).

Okay, so i think I know what I did wrong - I set the preferences, and put them into the Office 2011 Preferences file per the afore mentioned website (Users/install/). But as a PKG file i didn't see the option to put FEU / FUT.

So am I correct in assuming that I need to put them into the /System/Library/User Template/English.lproj/Documents and /System/Library/User Template/English.lproj/Library/Preferences
?

bentoms
Release Candidate Programs Tester

For FEU/FUT's you need a dmg.

ImAMacGuy
Valued Contributor II

Okay, so close and yet so far, I moved the files into those folders, however now everytime I sign into the box it sets up a new account.

Would it behoove me to to just create a dmg do put in the FUT/FEU stuff in that instead of just the office preference pkg file?

talkingmoose
Moderator
Moderator

Ben is correct that packages must be in .dmg format to use FEU/FUT. I need to update that page with how I worked around this problem. Here's what I did in my own environment.

First, a screen shot of my preferences package:

external image link

Instead of putting the dummy identity in /private/tmp I put it into the Office First Run folder. Technically, anything put into this folder should copy to the user's home folder if these items don't exist. I could never get this to work reliably.

The dummy identity could still go into /private/tmp/ but putting it into the Office First Run folder gives me access to it if I need to copy it manually later for some reason such as troubleshooting.

Next, the script from my preferences package:

#!/bin/sh
## postflight

cd /private/tmp

unzip "Office Installer.mpkg.zip"

    if (test $? = 0) then
        date '+%A %m/%d/%Y %H:%M:%S     Office 2011 Installer unzipped.' >> /var/log/merrillsetup.log
    else
        date '+%A %m/%d/%Y %H:%M:%S     ERROR! Unable to unzip Office 2011 Installer.' >> /var/log/merrillsetup.log
        exit 1
    fi

installer -pkg "Office Installer.mpkg" -target / -applyChoiceChangesXML choices.xml

    if (test $? = 0) then
        date '+%A %m/%d/%Y %H:%M:%S     Office 2011 installed.' >> /var/log/merrillsetup.log
    else
        date '+%A %m/%d/%Y %H:%M:%S     ERROR! Unable to install Office 2011.' >> /var/log/merrillsetup.log
        exit 1
    fi

rm /Users/*/Library/Preferences/com.microsoft.*

    if (test $? = 0) then
        date '+%A %m/%d/%Y %H:%M:%S     All com.microsoft.* files removed from all Users folders.' >> /var/log/merrillsetup.log
    else
        date '+%A %m/%d/%Y %H:%M:%S     ERROR! Unable remove all com.microsoft.* files from all Users folders.' >> /var/log/merrillsetup.log
        exit 1
    fi


# Copy Office 2011 Identity to existing user folders.

cd /Users

for AUSER in *
do
    if (test ! $AUSER = "Shared") then
        ditto "/Applications/Microsoft Office 2011/Office/Office First Run/MUD/Merrill Main Identity" "/Users/$AUSER/Documents/Microsoft User Data/Office 2011 Identities/Main Identity"
        chown -R $AUSER "/Users/$AUSER/Documents/Microsoft User Data/Office 2011 Identities"

        if (test $? = 0) then
            date "+%A %m/%d/%Y %H:%M:%S     Office 2011 Main Identity copied to user folder $AUSER." >> /var/log/merrillsetup.log
        else
            date "+%A %m/%d/%Y %H:%M:%S     ERROR! Unable to copy Office 2011 Main Identity to user folder $AUSER." >> /var/log/merrillsetup.log
        fi
    fi
done



# Copy Office 2011 Identity to the User Template folder.

ditto "/Applications/Microsoft Office 2011/Office/Office First Run/MUD/Merrill Main Identity" "/System/Library/User Template/English.lproj/Documents/Microsoft User Data/Office 2011 Identities/Main Identity"


if (test $? = 0) then
    date "+%A %m/%d/%Y %H:%M:%S     Office 2011 Main Identity copied to User Template folder." >> /var/log/merrillsetup.log
else
    date "+%A %m/%d/%Y %H:%M:%S     ERROR! Unable to copy Office 2011 Main Identity to User Template folder." >> /var/log/merrillsetup.log
fi

exit 0

The script does the following:

  1. Unzips the Office installer and installs it using the choices.xml file.
  2. Removes earlier Microsoft preferences from each user folder.
  3. Dittos the "Merrill Main Identity" folder from the Office First Run folder to each user's home folder naming it just "Main Identity".
  4. Dittos the "Merrill Main Identity" folder from the Office First Run folder to the Mac OS X User Template folder naming it just "Main Identity".

I did a lot of this to work around a couple of problems at the time.

  1. Casper wouldn't install files into /private/tmp/ if the package were a DMG file. It would only install them if part of a PKG file.
  2. FEU/FUT didn't support local Active Directory user home folders.

Casper 8.5 now supports FEU/FUT with local Active Directory home folders. If you place files into a location other than /private/tmp/ (such as /Library/Application Support/JAMF/Waiting Room/" then you can go ahead and use a DMG package, take advantage of FEU/FUT and avoid the part of the script that copies files to user home folders and the User Template folder.

Hope that makes sense. Let me know if it doesn't.

ImAMacGuy
Valued Contributor II

Oh that helps. I have everything except for the Main Identity stuff- what goes in that folder?

Just the Microsoft User Data and Preferences files?

jarednichols
Honored Contributor

Pretty much, and you likely don't need all the prefs either. I think there's a licensing one and an outlook one and that's the bare minimum.

ImAMacGuy
Valued Contributor II

Hmm. It's close. But it's not copying the identity stuff - first it errored out with

ERROR! Unable remove all com.microsoft.* files from all Users folders.' >> /var/log/office2011setup.log

Soi changed the exit 1 to exit 0 (figuring that if there's nothing there to delete then it shouldn't exit the whole script)

But it never does the copying portion (i dont think) and outlook just prompts to create the info.

Here's the contents of my path for the identities...external image link

talkingmoose
Moderator
Moderator

You won't really "put" anything in the Main Identity folder yourself. You'll use Outlook to create it on your test machine or in a test account and then add it to your preferences package.

Jared's right that its contents will be very minimal.

ImAMacGuy
Valued Contributor II

right, I ran the 2nd script - which created the plist and the other folder of stuff with the settings - i just dumped the folder and plist files into the office first run folder.

ImAMacGuy
Valued Contributor II

found something new - not sure if this is because it's version 14.2.1 or because I'm running this on Lion.

But i just did a clean box, manually installed Office 14.2.0, patched to 14.2.1, then copied the configuration script to /Library/Sears Scripts...
Created the test account, signed in, setup the junk mail filters and told it to schedule that script on startup.

From there I ran the other script to set as user template, and signed on under my domain ID.

Now I checked the documens folder, and there's no Microsoft User Data folder.

Instead there's ~/Documents/Office 2011 Identities, Outlook Sound Sets, and Saved Attachments.

When I look at the box I pushed the preference file I / we've been working on, it shows ~/Documents/Microsoft User Data/Office 2011 Identities, Outlook Sound Sets, and Saved Attachments.

That being said, I just checked on this machine, and which was installed off Office 2011 SP1 version, it has the latter setup with the M.U.D./Office2011 etc.

*update*
Tried to run Outlook, it didn't do anything. I rechecked the doc folder and it then created the Microsoft User Data folder, to which I copied the Identities, Sound sets, and saved attachments folders into. Then it launched properly.

ImAMacGuy
Valued Contributor II

Can you either send me a screen cap of teh dir structure of the /Office First Run/MUD/Merrill Main Identity folder?

I think that's where I'm going wrong.

ImAMacGuy
Valued Contributor II

I finally just created a user template DMG file with the outlook files in it...That seems to work, but when I deployed it to a box that had 2008 already, it screwed up the 2008 startup thingy - and it was prompting to re-register it.

It didn't touch the config - but re-prompts the users for configing the autoupdate and stuff.

Thank you for all your help!

franton
Valued Contributor III

Great script talkingmoose! Having trouble with a couple things. We're deploying out 14.1.0 and the script completes the user account successfully BUT fails to delete itself from the scheduled task list and doesn't turn enable online mode again. Any thoughts? I'm using script 4.0.1.

franton
Valued Contributor III

Oh and small note: It looks like the script isn't setting the LDAP server port number despite having a variable to specify it earlier in the script!

teknikal35
New Contributor III

A

teknikal35
New Contributor III

Hi Guys, i have a completly different problem, the script works when I log in with my details , open up outlook for the first time after the script kicked in , a prompt asks for my email password at first nothing happen, i found out why, even though the user logs in with the AD account to the machine we are not using the kerberos . authentication method so under sectIon A property usekerberos choose false . even though the mac is bound to AD we have to choose false , single sign is not implemented property, the authentication method should be username and password.

Also when I check the the account settings the server details should https://webmail.exchangeserver.com/ews/exchange.asmx

in the script pointing to property for extended exchangeserveraddress choose false if your exchange server is 2007 version .

I am not out of the woods yet every thing works but each time i reopen outlook another acount is created again, i delete the EXCHANGE schedule that fixes that issue but the inbox in first account created starts downloading the inbox again , there is a loop issue somewhere. ANY IDEAS

tkimpton
Valued Contributor II

How are you guys getting on with this? In about a months time I've been tasked with testing it working form UAT on a test network to full deployment in a week!

talkingmoose
Moderator
Moderator

FYI, I have a slightly newer version of the script posted on github:

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

It's essentially the same as the 4.0.1 script but has some minor fixes including the missing LDAP port and better Active Directory pathing for Lion and Mountain Lion. The only reason I haven't posted it officially is that it includes an Entourage import/upgrade feature that's never worked as smoothly as I'd like.

The list of fixes includes:

4.5.1

• Added missing ldap port property to account setup.

4.5

• Added support for Entourage import.
• Corrected Active Directory pathing for email lookups.
• Added support for Lion and Mountain Lion Active Directory pathing.
• Changed to "system info" to get short name.
• Corrected an issue where first and last name were not set when using dscl (thank you to Matthew Cahill).
• Corrected in-script instructions 2e: Name should be "Exchange Setup" not "Outlook Setup"

Sorry for not keeping it as up-to-date as I use to do. I've been very absent from the forums since starting a new job back in October. Please email me at the address included in the script and I'll try to respond to individual issues you may find.

wahack
New Contributor

The script errors but seems to create the account where the password field is blank. It is not prompting the user for a password?

tkimpton
Valued Contributor II

talkingmoose
Moderator
Moderator

The script itself won't ask for a password. That occurs when the script sets Outlook to Work Online and Outlook attempts to connect. Feel free to ping me here or offline for help. The longer it gets the more tweaking it seems to need for various environments.

Kyuubi
Contributor

@talkingmoose Does the script at the link above your last post work on El Capitan with Office 2011 14.6.2?

talkingmoose
Moderator
Moderator

@Kyuubi, hmm... interesting question.

The AppleScript itself didn't really change much as far as the Outlook commands. It may very well work with 2011 (I think someone told me it did some while ago).

The triggering launch agent and shell script, though, will only work with the new Outlook 2016 folder structure.

The script might have a hard time too if both Outlook 2011 and 2016 were installed because both use the same application identifiers.

So, to answer your question... As it's designed today, it only works with Outlook 2016, but it could probably be adjusted to work with 2011.