Solved

Exchange powershell command to add and make primary smtp address

Posted on 2016-08-17
4
398 Views
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
}
0
Comment
Question by:Jorge Ocampo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

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.
0
 
LVL 2

Author Comment

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

Accepted Solution

by:
Adam Brown earned 500 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.
0
 
LVL 2

Author Closing Comment

by:Jorge Ocampo
ID: 41786470
not the full answer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SMTP Receive connector logging 1 46
Multiple Domains in Exchange 2016, Outlook 2010 5 30
I'm being stupid with my powershell 2 28
Add Log to powershell Script 14 30
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
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…
In this video we show how to create a mailbox database 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 Servers >> Data…

751 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