Laptop users who move between their company network and another network, such as a home or a coffeehouse network, may need to connect to different Exchange Server addresses depending on the location. For example, at work I connect Entourage 2004 directly to a back-end Exchange Server but at home I connect it to my company’s Outlook Web Access (OWA) front-end server. Entourage does not give me the ability to store both server addresses and switch between them easily, so I've written this AppleScript to do it for me automatically.
Why would I not always use my company’s OWA address? Using the Internet webmail address from inside a company network may result in sluggish activity and long delays sending or receiving mail. Depending on the network topology Entourage may be leaving the company network to go to the Internet and connect to the OWA server, which in turn must connect to the internal Exchange Server that contains the email account. That’s a lot of hops. Connecting directly to the back-end Exchange Server is usually faster.
This is a script in progress and I’m asking you for some input into how it will eventually work and be documented. My goal is to make it easy for anyone to understand and use but since my technical writing skills are from the viewpoint of a technical analyst working in IT I can make a non-techie’s eyes cross in just a few sentences if not careful. Fresh eyes make anything better.
First, how should the script work? I thought of three scenarios for how the end user would interact with the script:
- Each time Entourage is launched ask which server address settings should be used.
- Automatically and silently change the server address settings based on the computer’s IP address.
- Ping each server to see what is available and then to use that server. Then automatically and silently change the server address settings based on the computer’s IP address.
The third scenario is my favorite but after testing it with my own company’s OWA server I found that the server is set not to respond to pings for security reasons. The first or second scenarios may be better.
Next, copy and paste the script code below into a new Script Editor window. The Script Editor application is found in the /Applications/AppleScript folder. I suggest saving the script in your Microsoft User Data folder in your home folder ~/Documents/Microsoft User Data/Scripts with a name like “ExchangeServerSwitcher.scpt”.
10 properties just below the instructions must be specified in the saved script. The first seven describe your company server settings and the last three describe your OWA server. The workNetworkIP property is tricky to describe. It should simply be the first part of your company’s IP address range. If the script detects your computer’s address as 10.1.22.30 then it will compare that to workNetworkIP property and set Entourage to use your company’s back-end Exchange Server. If the script detects your computer’s address as 192.168.1.5 then it will compare that to workNetworkIP property and set Entourage to use your OWA server. The rest of the settings should be fairly straight forward but I'll document these in detail later.
Finally, create a schedule in Entourage that points to the script. It should execute at Startup and trigger the Run AppleScript action. Click the Script… button to select the saved script. The script is ready to run the next time you launch Entourage. If you’re able to access your Exchange account while connected to your company network and home network and never have to change server settings then it has accomplished its mission.
This script should not destroy or lose any of your Exchange information but it also hasn’t been thoroughly tested. Practice safe testing and back up your identity found in your MUD first.
Please post your comments, problems and suggestions here so that all interested folks can learn from your thoughts or experiences. The final script and documentation will be posted later in the Exchange section of The Entourage Help Page.

Comments (9)
The ip address check should be "starts with" and not "does not start with". The logic is backwards.
1. It works. Thank you!
2. You can place it in ".../MUD/Entourage Script Menu Items" and call it from the script menu
3. You have to select Send & Receive All from your schedules if you want it to sync immediately. Is there any way to get the script to do this?
Thanks!
I downloaded and tested this and it works great! I peeked in the admin setup script to figure out how to set kerberos to true when connecting internally, and that appears to work as well. Thanks for a great script!
Tobias, thank you for the kudos! Always nice to hear that folks find the scripts useful. :-)
Does this work with Entourage 2008?
Yes, I am using it with 2008.
I am trying to use this script but I am somewhat new to using apple script and editing content. I think I have all of the network and server properties correct but I am unsure of what I should edit in the 'Determine the current network
-- and set the appropriate server'
section,
Could someone help me a little on this - do I edit (system info) and if so, where do I find that info.
Thanks,
Hi Ryan!
You don't need to edit anything in that section. Just edit the 10 lines that begin with "property".
Where you see something like
that means "workExchangeServerAddress" = "exchange1.domain.com". Later in the script where you'll see "workExchangeServerAddress" the script knows to substitute "exchange1.domain.com".
Do this substitution in your mind for all those properties and you'll probably have an easier time reading the script.
Let me know if that doesn't clear things.
Tobias or anybody who knows, would you post how to enable kerberos for the internal setup? thank you.
Thanks a million it works 100% with Entourage 2008!! You just made life easier for me.. Keep up the good work and thanks for sharing your knowledge.