Need Help - Adding Alias Addresses to Mail Users in O365

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Alex Alex 5 months ago.

  • Author
    Posts
  • #46074
    Profile photo of Luke J Osborne
    Luke J Osborne
    Participant

    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

  • #46084
    Profile photo of Alex
    Alex
    Participant

    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.

You must be logged in to reply to this topic.