Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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,337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

688 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