Solved

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

Posted on 2013-10-23
5
1,296 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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