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

x
?
Solved

How to change External SMTP Address for Mail Contacts in Exchange 2007

Posted on 2009-03-30
6
Medium Priority
?
996 Views
Last Modified: 2012-08-13
Hi there,

i have nearly 200 external Mail contacts on an exchange 2007. I need to change the external SMTP Adress from firstname.lastname@external.old to firstname.lastname@external.new by April 1st 00:00 hour. What would be the right powershell comand, when i use the customattribute1 as a filter?
Thanks in advance.
0
Comment
Question by:ok-disaster
6 Comments
 
LVL 6

Assisted Solution

by:defkamel
defkamel earned 150 total points
ID: 24023107
0
 
LVL 2

Author Comment

by:ok-disaster
ID: 24026853
hey thanks,
it seems to go in the right direction.
BUT: how is it done to be the external email address?
I still have to open the external contact choose the mailaddress and klick on "use as external"
sorry got the exchange 2007 in german. so I do not know what it says in english
0
 
LVL 6

Assisted Solution

by:KevinBall
KevinBall earned 150 total points
ID: 24026893
To change settings for a contact, you can use the powershell command Set-MailContact which can be used to alter pretty much every attribute.  The one you want is -ExternalEmailAddress
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 2

Author Comment

by:ok-disaster
ID: 24027084
could you please tell me what the command would be? unfortunately i am not so much into powershell commands ;-)
something like: Set-MailContact -Filter CustomAttribute1 -eq "test" -ExternalEmailAddress "%g.%s@external.new"
I tried this but it says that i cannot use filter with the set-mailcontact command
0
 
LVL 12

Accepted Solution

by:
GusGallows earned 450 total points
ID: 24335879
I know you wanted this by April 1st, but I just didn't see it till now. If you still need the answer, try the following:

Not sure if this helps you now, but if not, maybe someone else will find it useful.
#Create a list of all mailcontacts where CustomAttribute1 = test
$mcontact = get-mailcontact | Where {CustomAttribute1 -eq 'Test'}
 
#go through the list one at a time
for ($i = 0; $i -le ($Contact.Length -1); $i +=1) 
{
#Get the firstname and lastname value from the contact record (not mailcontact)
$contact = get-contact $mcontact[$i]
$FN = $contact.FirstName
$LN = $contact.LastName
#Create the SMTP address based on the firstname and lastname
$eSMTP = "$FN.$LN@external.new"
#Set the ExternalEmailAddress to the new address
Set-MailContact $contact -ExternalEmailAddress $eSMTP
}

Open in new window

0
 
LVL 12

Assisted Solution

by:GusGallows
GusGallows earned 450 total points
ID: 24335888
DOh, just noticed an error. The following:
$mcontact = get-mailcontact | Where {CustomAttribute1 -eq 'Test'}
should read
$mcontact = get-mailcontact | Where {$_.CustomAttribute1 -eq 'Test'}
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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.
Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

926 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