Quantcast
Channel: Powershell – TheITBros
Viewing all articles
Browse latest Browse all 91

How to Add or Remove SMTP Alias to Exchange 2016 Mailbox

$
0
0
exchange 2016

Sometimes you need to add another email address to the existing user. In Exchange, in addition to the primary address, each mailbox can be assigned to several additional ones (called aliases or proxy addresses). In Active Directory, additional aliases are stored in the recipient’s multi-valued attribute named proxyAddresses. Proxy addresses allow user to receive mail sent to different addresses. Any email sent to the user’s proxy address is delivered to the primary e-mail address mailbox, called the default response address.

For example, we need to assign a user with the primary SMTP address JunminH@contoso.com a shorter name (surname) alias address — hao@contoso.com.

In Exchange Server 2016 you can add an additional SMTP alias to the user using the Exchange Admin Center or the Exchange Management Shell.

To add an SMTP alias to a user using EAC, follow these steps:

  1. Select Recipients -> Mailboxes;
  2. In the list of users, select the desired user and double-click on it (or press on the pencil icon);
    exchange admin center alias
  3. Click on the Email address tab and press +;
  4. In the Email address field enter a new alias email address (hao@contoso.com);
    exchange email SMTP
  5. Press OK -> Save.

Also you can manage SMTP aliases by using the PowerShell console. Run the Exchange Management Shell with Administrator privileges. For example, you can display the list of a SMTP aliases and the primary address for the junminh mailbox using this command:

Get-Mailbox junminh | fl EmailAddresses, PrimarySmtpAddresses

email address exchange

You can change SMTP addresses associated with the mailbox by using the Set-Mailbox cmdlet with the EmailAddresses parameter, but there is one subtlety here. The fact is that EmailAddresses is a multi-valued attribute, so to add addresses to the list, you need to use the add method, for example:

Get-Mailbox junminh | Set-Mailbox -EmailAddresses @{add=”hao@contoso.com","junminh@contoso.local",”manager@contoso.com”}

get email address exchange

Accordingly, you can remove proxy addresses by using the remove method, for example:

Get-Mailbox junminh | Set-Mailbox -EmailAddresses @{remove="manager@contoso.com"}

And one more way to change addresses! This method works somewhat differently — it completely removes the original list and replaces it with the specified one. For example:

Get-Mailbox junminh | Set-Mailbox -EmailAddresses SMTP:junminh@contoso.local, manager@contoso.com

If you have many users whom you need to assign a new SMTP aliases, you need to create .csv file of the following kind (comma delimited):

proxyaddresses,mail
jsmith@contoso.com,john@contoso.com
kabrams@contoso.com,ken@contoso.com

And run the following command in the Powershell console:

Import-Csv -Path "C:\PS\user_proxyadresses.csv" | ForEach-Object { Set-Mailbox $_."mail" -EmailAddresses @{Add=$_."proxyaddresses"} }

PowerShell commands that is described above work on Exchange 2010, 2013 and 2016.

The post How to Add or Remove SMTP Alias to Exchange 2016 Mailbox appeared first on TheITBros.


Viewing all articles
Browse latest Browse all 91

Trending Articles