Solved

VBscript to Forward Email to external address and leave copy on mailbox (AD & Exch 2003)

Posted on 2013-10-23
5
1,238 Views
Last Modified: 2013-11-03
I have a requirement to write a VBscripts for three scenarios in a Active Directory 2003\Exchange 2003 environment to ...

1. Create Mail-Enabled User with internal email address and external forwarding email address.
2. Modify existing Mail-Enabled user with new internal email address and external forwarding email address.
3. Modify existing Mailbox-Enabled user with external forwarding email address and to leave copy of all email in internal AD mailbox

Your help in this matter is sincerely appreciated

Ukpowo
0
Comment
Question by:ukpowo
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:florin_s
Comment Utility
0
 

Author Comment

by:ukpowo
Comment Utility
Thanks florin_s for your response however I am working on a clients site and will not be allowed to update their exchange environment in addition I don't have the time to familiarise myself with powershell (Must Do So in the Immediate Future).

This is my current take on the scenarios ...

1. Create Mail-Enabled User with internal email address and external forwarding email address.
a) Create mail enabled users using ObjUser.MailEnable strinternalSMTP
b) Set targetaddress ... ObjUser.Put "targetaddress", strExternalSMTP

2. Modify existing Mail-Enabled user with new internal email address and external forwarding email address.
a) set New Primary SMTP via mail & old\new SMTP addresses viaproxyaddress attributes
b) Set targetaddress ... ObjUser.Put "targetaddress", strExternalSMTP.

3. Modify existing Mailbox-Enabled user with external forwarding email address and to leave copy of all email in internal AD mailbox
a) set New Primary SMTP via mail & old\new SMTP addresses viaproxyaddress attributes
b) Set targetaddress ... ObjUser.Put "targetaddress", strExternalSMTP.
c) Unsure what attribute needs to be set\amended to keep mail in interal org mailbox.
0
 
LVL 12

Expert Comment

by:florin_s
Comment Utility
well, I do not think that I can help you with VB, as I am not familiar with it but here is a link that can help:

http://www.slipstick.com/outlook/rules/run-script-rule-change-subject-message/
0
 

Accepted Solution

by:
ukpowo earned 0 total points
Comment Utility
I have found the solution myself ...

Scenarios 1 and 2 are straightforward.

Scenario 1\2

'Mail-Enable Created User Object
Set ObjUser =  GetObject("LDAP://" & UserDN)
ObjUser.MailEnable strNewPrimaryExchSMTP
ObjUser.Put "internetEncoding",1310720      
ObjUser.SetInfo

'set target address
ObjUser.Put "targetaddress", strExternalSMTP
ObjUser.SetInfo



Scenario 3

create Contact and set as altRecipient

ObjUser.Put "altRecipient", strContactDN
'Leave copy of email in on-premise mailbox
ObjUser.Put "DeliverandRedirect", True
ObjUser.SetInfo
0
 

Author Closing Comment

by:ukpowo
Comment Utility
No reply consequently embarked on research to find solution.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now