Professional Geek
RSS icon Email icon Bullet (black)
  • Change Mail Redirection in VBScript – Exchange 2003

    Posted on April 17th, 2007 Andy Parkes 2 comments

    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 (info@blahdomain.com) 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
    strUserName=”Parkesy”

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

    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 MSExchange.org 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. He is also Microsoft Partner Area Lead for 2012-2013 and coordinates AMITPRO which is a peer group for IT Professionals in the Midlands area. He also isn't a fan of describing himself in the third person.

    Latest posts by Andy Parkes (see all)

     

    2 Responses to “Change Mail Redirection in VBScript – Exchange 2003”

    1. 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

    2. 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