Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-10-23
5
Medium Priority
?
1,352 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses
Course of the Month12 days, 16 hours left to enroll

971 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