Solved

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

Posted on 2013-11-22
2
681 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 35

Accepted Solution

by:
Mahesh earned 500 total points
Comment Utility
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
Comment Utility
Thank you.
0

Featured Post

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

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…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
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 an Address List 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 Organization >> Ad…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now