Hi all

I wrote a script to help set up Entourage with an Exchange server, but it is not working. The script will fill in all the fields correctly but the account will never connect.

But when I use the the setup assistant it works. In the setup assistant I will enter the email address, User ID, Domain and password, then click the next arrow to step 2. At this point the setup assistant will give me an error that it cannot find the following account settings; Name, Exchange server, Directory server and Free/Busy server.

I then click configure manually and enter the same info that my script does and then the Exchange account works. So what is the setup assistant doing that my script is not? I end up with identical setups but one works and the other does not.

The script is designed to to run from an Active Directory user account so it will get the correct user info.

Peace, Tim and thank you ahead of time.

--
Timothy P. Kendall
Apple Consultants Network
Apple Certified Technical Coordinator (ACTC)
[EMAIL PROTECTED]

My Script feel free to borrow from it.


tell application "Finder"
        -- this will be the AD account name "first.last"
        -- Ask for this info
        activate
        try
                -- Get the current user
                tell me to set userName to do shell script "whoami"
                -- Convert current user's name to first intial and last name
                tell me to set theShortName to shortName(userName)
                -- Converts current user's name to a proper name
                tell me to set theFullName to reverseNames(userName)
                -- This is a list of email domains to use
                set suffixList to {"domain1.com", "domain2.com", "domain3.com"}
                -- ask for the Account name
set theFullName to text returned of (display dialog "Please confirm Account name, if wrong enter correct Account name." default answer theFullName buttons {"cancel", "OK"} default button "OK")
                -- Ask for the email prefix
set theEmailPrefix to text returned of (display dialog "Please confirm email prefix. If wrong enter correct prefix." default answer theShortName buttons {"cancel", "OK"} default button "OK")
                --Ask for the email Suffix
set emailSuffix to (choose from list suffixList with prompt "Please choose the correct email suffix: " without multiple selections allowed and empty selection allowed) as string
                set emailComplete to theEmailPrefix & "@" & emailSuffix
                -- Ask for the AD account
set adAccountID to text returned of (display dialog "Please confirm correct Account ID. If wrong enter correct Account ID." default answer userName buttons {"cancel", "OK"} default button "OK")
                -- Display confirmation window
display dialog "Entourage will now be set up with these settings." & return & "Account Name: " & theFullName & return & "Email address: " & emailComplete & return & "Account ID: " & adAccountID
        on error errorMesg
display dialog "There was an error gathering user information:" & return & errorMesg buttons {"Cancel"} default button "Cancel" with icon stop
                tell me to stop
        end try
end tell



tell application "Microsoft Entourage"
        try
set theAccountProperties to {name:theFullName, full name:theFullName, email address:emailComplete, Exchange ID:adAccountID, domain:"mycompany", Exchange server settings: {address:"https://mail.company.com";, requires SSL:"true"}, public folder server settings:{address:"serverex40.na.corp.company.com", requires SSL:"false"}, LDAP server settings: {address:"server04.na.corp.company.com"}, LDAP requires authentication:"true"}
                --display dialog theAccountProperties
                
                make new Exchange account with properties theAccountProperties
        on error errorMesg
display dialog "There was an error setting up Entourage:" & return & errorMesg & return & "Please configure Entourage manually." buttons {"Cancel"} default button "Cancel" with icon stop
                tell me to stop
        end try
end tell

tell application "Finder"
        activate
(display dialog "All Done" buttons {"Done"} default button "Done" with icon note)
end tell

-- this converts the current user's name to a proper name. It first parse out the first and last names then capitalizes the names.
on reverseNames(accountName)
        repeat with i from 1 to (length of accountName) by 1
                --return
                set xA to i
                if (character i of accountName) = "." then
                        --set xB to i
                        set firstName to characters (1) thru (i - 1) of 
accountName as string
set lastName to characters (i + 1) thru (length of accountName) of accountName as string
                        --set theName to lastName & ", " & firstName
                        set theName to firstName & " " & lastName
                        -- this will change the capitalize the every word.
                        set properName to changeCase of theName to "title"
                        --changeCase of someText to "title"
                        return properName
                end if
        end repeat
end reverseNames
-- This converts the current user's name to first initial + last name
on shortName(accountName)
        repeat with i from 1 to (length of accountName) by 1
                --return
                set xA to i
                if (character i of accountName) = "." then
                        --set xB to i
                        set firstName to characters (1) thru (i - 1) of 
accountName as string
set lastName to characters (i + 1) thru (length of accountName) of accountName as string
                        set firstIntial to character 1 of firstName as string
                        set theShortName to firstIntial & lastName
                        return theShortName
                end if
        end repeat
end shortName


------------

-- This is from "kai" a Moderator at http://macscripter.net/ for changing case property alphaList : "abcdefghijklmnopqrstuvwxyz"'s items & reverse of "ABCDEFGHIJKLMNOPQRSTUVWXYZ"'s items

on textItems from t
        try
                t's text items
        on error number -2706
                tell (count t's text items) div 2 to ¬
                        my (textItems from (t's text 1 thru text item it)) & ¬
                        my (textItems from (t's text from text item (it + 1) to 
-1))
        end try
end textItems

to changeCase of t to c
        if (count t) is 0 then return t
        considering case
                if c is not in {"upper", "lower", "title", "sentence"} then
error "The word \"" & c & "\" is not a valid option. Please use \"upper\", \"lower\", \"title\" or \"sentence\"."
                else if c is "upper" then
                        set n to 1
                else
                        set n to -1
                end if
                set d to text item delimiters
                repeat with n from n to n * 26 by n
                        set text item delimiters to my alphaList's item n
                        set t to textItems from t
                        set text item delimiters to my alphaList's item -n
                        tell t to set t to beginning & ({""} & rest)
                end repeat
                if c is in {"title", "sentence"} then
                        if c is "title" then
                                set s to space
                        else
                                set s to ". "
                        end if
                        set t to (t's item 1 & s & t)'s text 2 thru -1
                        repeat with i in {s, tab, return, ASCII character 10}
                                set text item delimiters to i
                                if (count t's text items) > 1 then repeat with 
n from 1 to 26
                                        set text item delimiters to i & my 
alphaList's item n
                                        if (count t's text items) > 1 then
                                                set t to textItems from t
                                                set text item delimiters to i & 
my alphaList's item -n
                                                tell t to set t to beginning & 
({""} & rest)
                                        end if
                                end repeat
                        end repeat
                        set t to t's text ((count s) + 1) thru -1
                end if
                set text item delimiters to d
        end considering
        t
end changeCase

--set someText to "this TEXT will be RETURNED with CHARACTERS CAPITALISED as SPECIFIED. any OTHER CHARACTERS will be LOWER CASE."

--changeCase of someText to "upper"
--> "THIS TEXT WILL BE RETURNED WITH CHARACTERS CAPITALISED AS SPECIFIED. ANY OTHER CHARACTERS WILL BE LOWER CASE."

--changeCase of someText to "lower"
--> "this text will be returned with characters capitalised as specified. any other characters will be lower case."

--changeCase of someText to "title"
--> "This Text Will Be Returned With Characters Capitalised As Specified. Any Other Characters Will Be Lower Case."

--changeCase of someText to "sentence"
--> "This text will be returned with characters capitalised as specified. Any other characters will be lower case."




--
To unsubscribe:
<mailto:[EMAIL PROTECTED]>
archives:
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to