Entourage account setup applescript not working

S

Sandi Chen

I am having a hard time getting an account setup applescript to work. The
issue does not seem to be with the script itself.

What happens is I can run the script and it appears to set up all entourage
settings correctly. When comparing the account settings on 2 computers,
there are NO differences between a manually setup machine and a scripted
one.

However, the scripted one does not work. The account it sets up (exchange)
shows up as not connected in the folders linst. The account folder does not
show an inbox, sent items, drafts, etc. It DOES show public folders, which I
can browse. I can also lookup addresses.

If I manually setup the account through entourage on the same machine, the
new account works fine.

So, there is something that the new account setup is not doing. I can't
figure this out. My setup is 0s 10.4.9 and Office 11.3.3.

Thanks!
Aaron
 
S

Sandi Chen

Sorry, I left out the Applescript and source.
http://www.entourage.mvps.org/downloads/scripts/EntourageExchangeSetup.dmg

I pasted the script at the end just in case.
I am having a hard time getting an account setup applescript to work. The
issue does not seem to be with the script itself.

What happens is I can run the script and it appears to set up all entourage
settings correctly. When comparing the account settings on 2 computers,
there are NO differences between a manually setup machine and a scripted
one.

However, the scripted one does not work. The account it sets up (exchange)
shows up as not connected in the folders linst. The account folder does not
show an inbox, sent items, drafts, etc. It DOES show public folders, which I
can browse. I can also lookup addresses.

If I manually setup the account through entourage on the same machine, the
new account works fine.

So, there is something that the new account setup is not doing. I can't
figure this out. My setup is 0s 10.4.9 and Office 11.3.3.

Thanks!
Aaron





(*

This script assists a user with the setup of his Exchange account
information.

1. Customize the network and server properties below with information
appropriate to your network.

2. Customize the format of your company's email addresses.

3. Save this script as an application and store it in a location where
any user can double-click it to set up his own email account.
Entourage should not yet be running when this script is run.

This script assumes the user's full name is in the form of "Last, First",
but is easily modified if the full name is in the form of "First Last".
It works especially well if the Mac is bound to Active Directory where
the user's short name will match his login name.

*)

--------------------------------------------
-- Begin network and server properties
--------------------------------------------

property domainName : "mydomain.com"
-- example: "domain.com"

property WindowsDomain : "MYDOMAIN"
-- example: "DOMAIN"

property ExchangeServer : "exchange01.mydomain.com"
-- example: "ExchangeServer.domain.com"

property ExchangeServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set
to true.

property ExchangeServerSSLPort : 80
-- If ExchangeServerSSL is false set the port to 80.
-- If ExchangeServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property PublicFolderServer : "exchange02.mydomain.com/public/"
-- example : "FreeBusyServer.domain.com/public/"

property PublicFolderServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set
to true.

property PublicFolderServerSSLPort : 80
-- If PublicFolderServerSSL is false set the port to 80.
-- If PublicFolderServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property LDAPServer : "ldap01.mydomain.com"
-- example: "GlobalCatalogServer.domain.com"

-- OWA connections can not use the OWA address.

property LDAPRequiresAuthentication : true
-- This will almost always be true. The LDAP server in a Windows network
-- will be a Global Catalog server, which is separate from the Exchange
Server.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSLPort : 3268
-- If LDAPServerSSL is false set the port to 3268.
-- If LDAPServerSSL is true set the port to 3269.
-- Use a different port number only if specified by your administrator.

-- OWA connections can not use the OWA address with this setting.

property LDAPMaximumResults : 100
-- When searching the Global Address list, this number determines
-- the maximum number of entries to display.

property LDAPSearchBase : ""
-- example: "cn=users,dc=domain,dc=com"

-- Search base will be optional in many environments and its
-- format will vary greatly. Experiment first connecting without
-- entering the search base information.

property scheduled : false
-- Exchange accounts don't require that the "Send & Receive All" schedule be
enabled.
-- Change this setting to true if the user will also be connecting to POP or
IMAP accounts.

property errorMessage : "Setup of your account failed. Please contact your
workstation administrator for assistance."
-- Customize this error message for your users if their account setup fails

--------------------------------------------
-- End server properties
--------------------------------------------

--------------------------------------------
-- Begin get user name
--------------------------------------------

-- user information is pulled from the account settings of the current user
account

tell application "System Events"
set shortName to name of current user
set fullName to full name of current user
end tell

--------------------------------------------
-- End get user name
--------------------------------------------

--------------------------------------------
-- Begin email address properties
--------------------------------------------

-- Email address formats vary between organizations.
-- Six common examples are give below but only one example should be used.
-- The rest should be commented out by adding "-- " to the beginning of the
line.
-- Your email address format may differ from all of these. If so,
-- you'll need to determine the proper script syntax and add your own entry.

-- example 1: (e-mail address removed) if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "." & word 1 of fullName & "@" &
domainName

-- example 2: (e-mail address removed) if full name displays as "First Last"
set emailAddress to word 1 of fullName & "." & word 2 of fullName & "@" &
domainName

-- example 3: (e-mail address removed) if full name displays as "First Last"
-- set emailAddress to word 1 of fullName & "@" & domainName

-- example 4: (e-mail address removed) if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "@" & domainName

-- example 5: (e-mail address removed) if full name displays as "First Last"
-- set emailAddress to character 1 of word 1 of fullName & word 2 of
fullName & "@" & domainName

-- example 6: (e-mail address removed) if full name displays as "Last, First"
-- set emailAddress to character 1 of word 2 of fullName & word 1 of
fullName & "@" & domainName

--------------------------------------------
-- End email address properties
--------------------------------------------

--------------------------------------------
-- Begin setup check
--------------------------------------------

-- Is Entourage already configured? This section checks for the existence
-- of an Exchange Server account already in Entourage. It assumes that
-- users will have only one Exchange Server account.

tell application "Microsoft Entourage"
if (exists of Exchange account 1) is true then
set theAnswer to display dialog "Entourage is already configured
with an email account. Are you sure you want to set up another email
account?" buttons {"Yes", "No, just use Entourage"} default button {"No,
just use Entourage"} with icon 2 with title "Alert!"
if button returned of theAnswer is "No, just use Entourage" then
display dialog "OK. Next time you can just launch Microsoft
Entourage directly." buttons {"OK"} default button {"OK"} with icon 1 with
title "For your information..."
return -- exits the script
end if
end if
end tell


--------------------------------------------
-- End setup check
--------------------------------------------

--------------------------------------------
-- Begin account setup
--------------------------------------------

try

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

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

tell application "Microsoft Entourage"
activate
make new Exchange account with properties {name:"Mailbox - " &
fullName, Exchange ID:shortName, domain:WindowsDomain, full name:fullName,
email address:emailAddress, search base:LDAPSearchBase, Exchange server
settings:{address:ExchangeServer, requires SSL:ExchangeServerSSL,
port:ExchangeServerSSLPort}, public folder server
settings:{address:publicFolderServer, requires SSL:publicFolderServerSSL,
port:publicFolderServerSSLPort}, LDAP server settings:{address:LDAPServer,
LDAP requires authentication:LDAPRequiresAuthentication, requires
SSL:LDAPServerSSL, port:LDAPServerSSLPort, maximum
entries:LDAPMaximumResults}}
try
close window "Entourage Setup Assistant"
end try

set enabled of schedule "Send & Receive All" to scheduled

end tell

on error

display dialog errorMessage with icon 2 buttons {"OK"} default button
{"OK"}

end try
[/QUOTE]
 
W

William Smith

I am having a hard time getting an account setup applescript to work. The
issue does not seem to be with the script itself.

What happens is I can run the script and it appears to set up all entourage
settings correctly. When comparing the account settings on 2 computers,
there are NO differences between a manually setup machine and a scripted
one.

However, the scripted one does not work. The account it sets up (exchange)
shows up as not connected in the folders linst. The account folder does not
show an inbox, sent items, drafts, etc. It DOES show public folders, which I
can browse. I can also lookup addresses.

If I manually setup the account through entourage on the same machine, the
new account works fine.

So, there is something that the new account setup is not doing. I can't
figure this out. My setup is 0s 10.4.9 and Office 11.3.3.
[/QUOTE]

Hi Aaron!

Also, as a means of troubleshooting, can you set Entourage to work
offline (Entourage menu --> Work Offline) and then work online again?
Does this trigger the scripted account to work? Does restarting
Entourage make the account connect?

Are you possibly running the script while Entourage is already running?
If so, try running it with Entourage quit and then let the script launch
Entourage. Please let me know if this makes a difference for you.

Thanks! bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top