Solved

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

Posted on 2009-03-30
6
920 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 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Contact 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 >> Contact ta…
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…

803 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