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


Exchange powershell command to add and make primary smtp address

Posted on 2016-08-17
Medium Priority
Last Modified: 2016-09-06
i have the below command but once pasted its a no go

description : Add smtp and make primary keeping existent proxy addresses


#CSV = alias,addnewemailaddress

import-csv .\AddSmtpMakePrimaryProxy.csv | foreach {
$user = Get-Mailbox $_.alias
$user.emailAddresses+= $_.addnewemailaddress
$user.primarysmtpaddress = $_.addnewemailaddress
Set-Mailbox $user -emailAddresses $user.emailAddresses
set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress
Question by:Jorge Ocampo
  • 2
  • 2
LVL 43

Expert Comment

by:Adam Brown
ID: 41760243
You have to disable email address policy application to be able to change the Primary SMTP address if it is different from the existing policy. If you need to make the Primary SMTP address to change on all users, don't script the change, modify the Address Policy to make the new address format the primary one.

Author Comment

by:Jorge Ocampo
ID: 41760259
i am only doing for a select few
LVL 43

Accepted Solution

Adam Brown earned 1500 total points
ID: 41760274
In that case, add
set-mailbox $user -EmailAddressPolicyEnabled $false

Open in new window

to your script before your first set-mailbox.

Author Closing Comment

by:Jorge Ocampo
ID: 41786470
not the full answer

Featured Post

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

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.
If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
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…

886 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