cawasaki
asked on
Powershell Script to modify primary SMTP adress and external adress for a contact in Exchange 2007
Hi,
I need a powershell script who can check a file with a list of user, for exemple this file:
John.smith
Jimmy.drick
sandra.mickeal
susane.langlish
All this user is a contact in my exchange 2007.
I need to modify all primary SMTP adress of this contact with this domain: newdomaine.com
I need also modify external adress of the contact to the same domain: newdomaine.com
I need to keep older smtp adress as secondary SMTP adress.
The script mast change all user contained in my txt or csv file.
For exemple the script must change John.smith@olddomain.com primary smtp to John.smith@newdomain.com
the script must also change external adress of the contact from John.smith@olddomain.com to John.smith@newdomain.com
Thanks for your help
I need a powershell script who can check a file with a list of user, for exemple this file:
John.smith
Jimmy.drick
sandra.mickeal
susane.langlish
All this user is a contact in my exchange 2007.
I need to modify all primary SMTP adress of this contact with this domain: newdomaine.com
I need also modify external adress of the contact to the same domain: newdomaine.com
I need to keep older smtp adress as secondary SMTP adress.
The script mast change all user contained in my txt or csv file.
For exemple the script must change John.smith@olddomain.com primary smtp to John.smith@newdomain.com
the script must also change external adress of the contact from John.smith@olddomain.com to John.smith@newdomain.com
Thanks for your help
ASKER
Hi,
It a contact not mailbox.
I just need a script to modify an existing contact like descripted.
thanks
It a contact not mailbox.
I just need a script to modify an existing contact like descripted.
thanks
This should be like what you are looking for:
Get-MailContact -Identitiy yourcontact@domain.local | SetMailContact -PrimarySmtpAddress "yourcontact@newdomain.loc al"
Here is another post with the same issue.
http://social.technet.microsoft.com/Forums/en/exchangesvradmin/thread/fa94c2eb-3259-4788-883e-abeb5ed0956b
Get-MailContact -Identitiy yourcontact@domain.local | SetMailContact -PrimarySmtpAddress "yourcontact@newdomain.loc
Here is another post with the same issue.
http://social.technet.microsoft.com/Forums/en/exchangesvradmin/thread/fa94c2eb-3259-4788-883e-abeb5ed0956b
ASKER
ok
this is a powershell command i need and teest it for 1 account:
Get-MailContact -Identitiy John.smith | Set-MailContact -PrimarySmtpAddress "John.smith@newdomain.com"
after this, i lunch:
Get-MailContact -Identitiy John.smith | Set-MailContact -ExternalEmailAddress "John.smith@newdomain.com"
OK, can you help my to put all this in 1 command and use a file with a list of contact to modify?
thanks
this is a powershell command i need and teest it for 1 account:
Get-MailContact -Identitiy John.smith | Set-MailContact -PrimarySmtpAddress "John.smith@newdomain.com"
after this, i lunch:
Get-MailContact -Identitiy John.smith | Set-MailContact -ExternalEmailAddress "John.smith@newdomain.com"
OK, can you help my to put all this in 1 command and use a file with a list of contact to modify?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Gus -
Elegant :)
Elegant :)
ASKER
Wow thanks GusGallows, its work for 2 account i tested.
I retest tomorow with 10 account and report the result.
thanks :)
I retest tomorow with 10 account and report the result.
thanks :)
Hey Cawasaki. How did the rest of your testing go?
ASKER
hey, sorry, your script is very good, i close this question :)
http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/managing-email-address-policies.html