Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-11-22
2
Medium Priority
?
692 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 38

Accepted Solution

by:
Mahesh earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

926 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