Solved

I need help with the script to set the specific email address as primary email address.

Posted on 2013-11-22
2
686 Views
Last Modified: 2013-11-25
Hello,
I am having a big issue. I ran this script and it was suppose to add just domain.onmicrosoft.com as additional email but somehow all users primary email addresses got changed to the one in the policy and now users email bownce.

So, please help me to write a new script that I can specify for each Organizational unit to set the email address as the primary and uncheck to apply automatic policy email option.



$users = get-mailbox
foreach ($a in $users) {$a.emailaddresses.Add("smtp:$($a.alias)@domain.onmicrosoft.com")}
$users | %{Set-Mailbox $_.Identity -EmailAddresses $_.EmailAddresses}
0
Comment
Question by:claudiamcse
2 Comments
 
LVL 36

Accepted Solution

by:
Mahesh earned 500 total points
ID: 39670975
Create a new E-mail Address Policies and apply to your users. After applying the E-mail address though E-mail Address Policy, the new SMTP address will be set to Default SMTP Address automatically. And the old STMP address will be the secondary SMTP address.

Run the following cmdlet on exchnage server to disable "Automatically update Email Addresses based on email address policy" for the mailbox users:
Get-mailbox| set-mailbox –emailAddressPolicyEnabled $false
Note: Get-mailbox command collects all your mailbox enabled users in your organization and set-mailbox disables the “Automatically update Email Addresses based on email address policy" option of these users.

Mahesh
0
 

Author Closing Comment

by:claudiamcse
ID: 39674740
Thank you.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
In this video we show how to create a Distribution Group 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 >>…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

828 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