Solved

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

Posted on 2009-03-30
6
935 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
[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
6 Comments
 
LVL 6

Assisted Solution

by:defkamel
defkamel earned 50 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 50 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
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.

 
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 150 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 150 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
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

623 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