Solved

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

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

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
In this video we show how to create a Shared Mailbox 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 >> Sha…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

821 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