Outlook 2011 SP2 - Exchange Setup Script Issues

chrispike
New Contributor II

Hello,

I posted this message over on Mac Enterprise, but I thought I might get some success by posting here as well.

I have been using William Smith's fantastic script<http://www.officeformachelp.com/outlook/exchange/setup-script/> and guide flawlessly with deploying Office 2011 SP1 to our users via Casper. After the package has been installed any new user who logs on can open Outlook and their Exchange account will be configured ready for use.

I am now trying to update our Office installer we deploy to new Macs to SP2. I am modifying Outlook's preferences and setting the script to run on startup, quitting Outlook, and then copying the modified preferences to the user template using the 'Copy Outlook Files' tool. This works for all the preferences I set and when I create a new account everything is as I set it up on the master account. The exception is the script, which doesn't run on Outlook's first launch. This worked when I first made this package with the Office 2011 SP1 installer.

My question is has anyone else out there packaged up the SP2 installer with William's script and got it to work when Outlook is launched for the first time?

Any help would be much appreciated!

Cheers
Chris

15 REPLIES 15

aburrow
Contributor

I've got the same issue. Did you find a solution at all?

acdesigntech
Contributor II

Make sure the script is referring the right applications in your tell blocks. I had a problem with it when updating to sp2 last year

davidacland
Honored Contributor II
Honored Contributor II

I've been using it for a while. My most recent issue with 10.8.2 & SP2 was this bit:

set emailAddress to do shell script "dscl . -read /Users/" & shortName & " EMailAddress | awk 'BEGIN {FS=": "} {print $2}'"

It was failing to grab the EMailAddress attribute so I switched it to:

set emailAddress to do shell script "dscl /Active Directory/SHORTDOMAIN/All Domains -read /Users/" & shortName & " EMailAddress | awk 'BEGIN {FS=": "} {print $2}'"

Everything else worked fine for me. It sounds like your the issue your facing is different but I thought I'd throw this in just in case it helps!

David

chrispike
New Contributor II

@aburrow Unfortunately not, I am still searching for a solution.

@acdesigntech Do you remember what you had to adjust in your script to get it working? I can see only two tell blocks 'Microsoft Outlook' and 'System Events' which appear OK.

@davidacland Thank you for that as it's useful to know. At the moment I am not using the getEMailAddressUsingDSCL function but using emailFormat instead.

I think I am going to carry on using the 14.1.0 Installer i built which works with the script and apply the 14.2.3 and 14.2.5 updates afterwards. This will cause the licencing issue to appear but I think there was an easy fix whereby you can replace the com.microsoft.office.licensing.plist file from a working Mac.

acdesigntech
Contributor II

I had to keep resetting the tell application "Microsoft Outlook" as I was playing around on a dev Mac that did not have Outlook 2011 installed, so a lot of the time the tell would reference some whacky code.

What you might want to try is creating your microsoft user identity from scratch with SP 2 (log in as a new user, set your prefs accordingly, etc). The rule that runs the AS on first launch of outlook actually resides in the main identity folder, not preferences. You might have to recreate the main identity folder. I do remember tinkering with that too as I packaged first SP 1, then when SP came out we still hadn't rolled out MS Office 2011, but I didnt have to take SP2 changes into account.

Skorry, that should read i DID have to take the SP2 changes into account

franton
Valued Contributor III

My experience of this script can be summed up as "buggy". I implemented this about a month ago, found some parts of the configuration variables hadn't been implemented!

If I get the chance, i'll post my very slightly modified version tomorrow.

aburrow
Contributor

I'd love to see what you've come up with. Although I believe I've resolved the issues with dscl getting the users email address as well as the mecontact.

The biggest issue I seem to be having now is the "Exchange Setup" Scheduled Task not running for new users. It's like the preference file that contains the scheduled tasks for the user isn't being copied over to the templateuser or the Anotherlocation area.

Does anyone know where the scheduled tasks are actually stored? I believe I've found the scheduled tasks under Microsoft User DataMain IdentityData RecordsSchedulesetcetc.

Even though I can see the "Exchange Setup" Task. It still doesn't run as any other user.

acdesigntech
Contributor II

Check the documents/ms office data/ms office 2011 identities/main identity

clifhirtle
Contributor II

Random question: these scripts are AppleScripts. How are you firing them off in Casper?

acdesigntech
Contributor II

I didn't. Since the user migration has to happen as the user themselves, I used talkingmoose's method of creating a scheduled job to launch this script upon first run of outlook. Worked like a charm.

I was not able to figure out how to run this via casper remote or policy. But I'd imagine that since it runs as the super user, you'd be able to issue a 'su <user>' and then invoke the applescript via a ```
osascript << EOS
script awesomeness
EOS
```

That SHOULD run the applescript as the user, from within bash.

Huber
New Contributor

@franton do you have a copy of your modified script that you can post or share? We're using this script in our environment. It works, but creates a 2nd and 3rd Untitled email account.

Huber
New Contributor

@franton do you have a copy of your modified script that you can post or share? We're using this script in our environment. It works, but creates a 2nd and 3rd Untitled email account.

franton
Valued Contributor III

I believe the script has been updated since I posted my previous reply. It may not be worth posting but my changes weren't to fix the behaviour you are seeing i'm afraid.

teknikal35
New Contributor III

hI , i am uisng the same script on outlook 2011 14.4.3 I tried enabeling the kerberos user account setup , the error our exchange server showed was this Exchange server does not use kerberos authentication**, the other issue the schedllued script the run when oultlook opens keeps looping after running and confiuring a users account once , maybe becasue I am using diiferent options verify user emasil and server address he script this it hasnot completed the script setup completely.

any ideas how to stop the loop shcedule runnign othere than maually enabling it affter the script has run once.

talkingmoose
Moderator
Moderator

@teknikal35

If the script is not deleting the schedule toward the end of its run then something just before it must be failing. The easiest advice I can offer for troubleshooting is to comment the lines toward the end that say "try" and "end try". Do this by adding "-- " before each line. Commenting means the script will ignore these lines.

Also, comment the "on error" line and all lines below it until you reach the "end try" line.

Here's the entire section as it should be modified:

if upgradeResponse is "New" then

    -- Configure a brand new Outlook database

    **[color=#FF0000]-- try[/color]**

        if verifyEMailAddress is true then
            set verifyEmail to display dialog "Please verify that your email address is correct." default answer emailAddress with icon 2 buttons {"Cancel", "OK"} default button {"OK"}
            set emailAddress to text returned of verifyEmail
        end if

        if verifyServerAddress is true then
            set verifyServer to display dialog "Please verify that your Exchange Server name is correct." default answer ExchangeServer with icon 2 buttons {"Cancel", "OK"} default button {"OK"}
            set ExchangeServer to text returned of verifyServer
        end if

        tell application "Microsoft Outlook"
            activate
            set newExchangeAccount to make new exchange account with properties ¬
                {name:"Mailbox - " & fullName, user name:shortName, full name:fullName, email address:emailAddress, server:ExchangeServer, use ssl:ExchangeServerRequiresSSL, port:ExchangeServerSSLPort, ldap server:DirectoryServer, ldap needs authentication:DirectoryServerRequiresAuthentication, ldap use ssl:DirectoryServerRequiresSSL, ldap max entries:DirectoryServerMaximumResults, ldap search base:DirectoryServerSearchBase, ldap port:DirectoryServerSSLPort}

            -- The following lines enable Kerberos support if the userKerberos property above is set to true.

            if useKerberos is true then
                set use kerberos authentication of newExchangeAccount to useKerberos
                set principal of newExchangeAccount to shortName & "@" & kerberosRealm
            end if

            -- The Me Contact record is now automatically created with the first account.
            -- Set the first and last name of the Me Contact record.

            set first name of me contact to firstName
            set last name of me contact to lastName
            set email addresses of me contact to {address:emailAddress, type:work}

        end tell

    **[color=#FF0000]-- on error

        -- display dialog errorMessage with icon 2 buttons {"OK"} default button {"OK"}
        -- error number -128

    -- end try[/color]**
end if

Run the script now and it should show you where the error occurs. Once you've identified the problem, you will want to uncomment the lines by removing the "-- " you added.