When you set up Address Book to synchronize your contacts with Exchange hourly you probably know the "iSync couldn't connect to Exchange - Could not reach the server specified." for example when you are using your powerbook on the way.
I put a small shell script together which replaces the ExchangeScheduler binary that is called by Apple's scheduler hourly. It has a list of all network locations it should sync in, checks reachability of the outlook web access server and starts the ExchangeScheduler binary then.
Save the following as ExchangeScheduler.sh
#syncLocations is a space seperated list of network location id's, the script should sync in.
#You can get your id's by entering scselect into Terminal.app.
activeLocation=`scselect 2>&1 | egrep '^\ *\*'| cut -c 4- | cut -c -36`
for i in $syncLocations
if [ "$activeLocation" == "$i" ]
if curl -k `defaults read com.apple.IISSupport IISServerPath` >/dev/null 2>&1
Open Terminal.app and do the following commands
#change current directory:
#rename ExchangeScheduler to ExchangeScheduler.bin:
sudo mv ExchangeScheduler ExchangeScheduler.bin
#create symlink from ExchangeScheduler.sh to ExchangeScheduler:
sudo ln -s ExchangeScheduler.sh ExchangeScheduler
#grant execute permission to ExchangeScheduler.sh
sudo chmod +x ExchangeScheduler.sh
Test the script by activating a network location that is in $syncLocations and do
If the Outlook Web Access Server is reachable the output should be
2004-09-05 10:11:51.302 ExchangeScheduler.bin Starting exchange sync