Change Mail Redirection in VBScript – Exchange 2003

Was doing some housekeeping and came across a script i thought i’d share

We had a customer who had a general information style email address ( that due to job sharing two different people were responsible for checking the email and replying. To add to this these people were external to the organisation. They wanted the email to be re-directed to their own email addresses (i did suggest that they just use Outlook Web Access and share a mailbox but they weren’t interested!)

So i created two external contacts and re-directed the email to the user. However this wasn’t something i wanted to be doing myself a couple of times as week as the responsibility changed and i didn’t trust the users!

So i created a script that ran on a scheduled task to make the change. I found it incredibily difficult to find anything out about this method at the time so here it is
‘ Change this name to alter re-direction

Set objUser = GetObject (“LDAP://cn=INFOUSER,ou=AP Users,dc=blahdomain,dc=local”)
objUser.Put “altRecipient”, “cn=” & strUserName & “,ou=AP Users,dc=blahdomain,dc=local”
objUser.Put “DeliverandRedirect”, True

I’ve trimmed the code down for display but all it does is find the “Info User”, reset the “Alt Recipient” and “Deliver and Redirect” properties, and persist the changes 

I created two copies of this and setup a scheduled task to make the switch

It seemed to work quite well but eventually the stopped the job share and it became an internal users responsibility and the script got “retired”

Hope it is of use to someone else

I used this script on an Exchange 2003 box. I haven’t tested it on an Exchange 2000 box but can’t see an inital reason for it not to.

Use the code as you see fit but i take no responsibility for anything that may occur due to it’s usage (blah blah blah!)

*-* Slight Update *-*

Going through some posts i hadn’t gotten around to reading and saw this post from Dave Overton which links to a tutorial on which talks about how to set all this up. My post assumes this is all in place

The following two tabs change content below.
Andy Parkes is Technical Director at Coventry based IT support company IBIT Solutions. Formerly, coordinator of AMITPRO and Microsoft Partner Area Lead for 2012-2013. He also isn't a fan of describing himself in the third person.

Latest posts by Andy Parkes (see all)

2 thoughts on “Change Mail Redirection in VBScript – Exchange 2003

  • I tried adding this snippit to my script and I am receiving an error.

    Error creating account: 438
    Object doesn’t support this property or method

  • Mark,
    Without knowing anything about your setup (or even what line the error is on) i can’t really give you an answer…

    My initial thought was that the LDAP details don’t match your setup?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.