Solved

Exchange powershell command to add and make primary smtp address

Posted on 2016-08-17
4
52 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
  • 2
  • 2
4 Comments
 
LVL 38

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 38

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

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create a Contact 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 >> Contact ta…
In this video we show how to create an email address policy 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 Mail Flow…

867 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