{"id":2699,"date":"2019-01-15T20:44:08","date_gmt":"2019-01-15T20:44:08","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2699"},"modified":"2019-01-15T20:48:06","modified_gmt":"2019-01-15T20:48:06","slug":"bulk-import-email-aliases-to-office-365-using-powershell","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2699","title":{"rendered":"Bulk import email aliases to Office 365 using Powershell"},"content":{"rendered":"<p><b>If you need to add email aliases to O365 accts in bulk use the following (EMS)\u00a0powershell\u00a0command with the CSV file formatted this way:<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td>Name<\/td>\n<td>ProxyAddresses<\/td>\n<\/tr>\n<tr>\n<td>user1@domainold.com<\/td>\n<td>user1@domainnew.com<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>Run this in EMS:<\/b><\/p>\n<p><span style=\"color: #00ff00;\"><i>Import-Csv C:\\email-aliases.csv |\u00a0ForEach-Object{ $name = $_.Name }<\/i>\u00a0<\/span><\/p>\n<p><span style=\"color: #00ff00;\"><i>Import-Csv C:\\email-aliases.csv |\u00a0ForEach-Object{ $proxy = $_.ProxyAddresses\u00a0-split \u2018;\u2019}<\/i>\u00a0<\/span><\/p>\n<p><span style=\"color: #00ff00;\"><i>Set-RemoteMailbox\u00a0-Identity $name -EmailAddresses\u00a0@{add= $proxy}<\/i>\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h1><i>OR<\/i><\/h1>\n<p>&nbsp;<\/p>\n<p><b>Get the display name and email alias in this CSV format.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>mailbox<\/td>\n<td>newemailaddress<\/td>\n<\/tr>\n<tr>\n<td>Phyliss Ames<\/td>\n<td><a href=\"mailto:pames@email.lifetouch.com\">pames@<\/a><a href=\"mailto:swhitten@email.lifetouch.com\">email.domain.com<\/a><\/td>\n<\/tr>\n<tr>\n<td>Shelley Whitten<\/td>\n<td><a href=\"mailto:swhitten@email.lifetouch.com\">swhitten@email.domain.com<\/a><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>Run in EMS:<\/b><\/p>\n<p><span style=\"color: #00ff00;\">Import-CSV &#8220;C:\\staging\\aliases2.csv&#8221; |\u00a0ForEach\u00a0{Set-RemoteMailbox\u00a0-identity $_.Mailbox -EmailAddresses\u00a0@{add=$_.NewEmailAddress}}\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to add email aliases to O365 accts in bulk use the following (EMS)\u00a0powershell\u00a0command with the CSV file formatted this way: &nbsp; Name ProxyAddresses user1@domainold.com user1@domainnew.com &nbsp; Run this in EMS: Import-Csv C:\\email-aliases.csv |\u00a0ForEach-Object{ $name = $_.Name }\u00a0 Import-Csv C:\\email-aliases.csv |\u00a0ForEach-Object{ $proxy = $_.ProxyAddresses\u00a0-split \u2018;\u2019}\u00a0 Set-RemoteMailbox\u00a0-Identity $name -EmailAddresses\u00a0@{add= $proxy}\u00a0 &nbsp; OR &nbsp; Get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,58,62,73,60,59],"tags":[],"class_list":["post-2699","post","type-post","status-publish","format-standard","hentry","category-exchange-2010","category-exchange-2013","category-microsoft-exchange-server-2016","category-exchange-server-2019","category-office-365","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2699"}],"version-history":[{"count":6,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2699\/revisions"}],"predecessor-version":[{"id":2705,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2699\/revisions\/2705"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}