Solved

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

Posted on 2013-10-23
5
1,273 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
ID: 39593787
0
 

Author Comment

by:ukpowo
ID: 39593833
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
ID: 39593964
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
ID: 39609306
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
ID: 39619693
No reply consequently embarked on research to find solution.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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