I have a spreadsheet with three columns; Name, Email Address (already in O365) and Secondary Email Address.
I need to add the SECONDARY EMAIL ADDRESSES to the users in Office 365 via a script or command but I am having no luck, can you help me?
Thanks
You will need to set the users mailbox to add an address.
Set-Mailbox “User″ -EmailAddresses @{add=”Newaddress@domain.com”}
So you would want something like:
$csv = import-csv file.csv
foreach($users in $csv)
{
set-mailbox $emailaddress -emailaddresses @{add="$secondaryemailaddress"}
}
I would do some testing with this though, as I do not have a O365 environment to test this on.
i.e. try:
set-mailbox $emailaddress -emailaddresses @{add=“$secondaryemailaddress”}
with one user and see if it works.
You will need to get a pssession into the exchange part of O365 to be able to do this.