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

x
?
Solved

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

Posted on 2009-03-30
6
Medium Priority
?
951 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 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create a mailbox database 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 Servers >> Data…

670 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