add 200 aliases to 1 exchange online account quickly

i have around 200 aliases that i need to add to 1 exchange online account
how can i do this quickly without having to type each one manually?
LVL 1
dougdogAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saif ShaikhServer engineer Commented:
You can connect to O365 powershell with the tenant global admin credentials and run command:

Set-Mailbox mailboxname -EmailAddresses @{Add='alias@somedomain.co.uk'}
0
Saif ShaikhServer engineer Commented:
To check current exchange mailbox aliases:

Get-Mailbox mailboxname | select -expand emailaddresses alias
0
Brian BEE Topic Advisor, Independant Technology ProfessionalCommented:
Building on what Saif said, when I have this type of problem, I put all the names/addresses in a list and paste it in to Excel. Then concatenate the rest of the text on to each line using copy and paste. Save it as a test file with a PS1 extension. Execute it in Powershell.

You could also use a "for... each" loop in powershell, but if it is a one-off task and you don't know Powershell very well, my idea works.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

dougdogAuthor Commented:
so how would i do this for 100s
Set-Mailbox mailboxname -EmailAddresses @{Add='alias@somedomain.co.uk'}
0
Saif ShaikhServer engineer Commented:
Hi,

Please download the script for the same from link: https://gallery.technet.microsoft.com/office/Over-200-aliases-da06ad0b

So as updated earlier by Brian put all the names/addresses in a list and paste it in to Excel. Then concatenate the rest of the text on to each line using copy and paste. Save it as a test file with email_addresses.txt

From power shell with admin right you need to run below command:

E.g.:
# .\Over_200_Aliases.ps1 -O365Admin admin@xxxxxx.onmicrosoft.com -O365AdminPassword Password123 -Mailbox_Name mailbox1 -Mail_Addresses_File_Path "C:\Temp\ExoVoice\email_addresses.txt"

Where
# O365Admin - Administrator login ID
# O365AdminPassword - Administrator login password
# Mailbox_Name - mailbox with more than 200 aliases
# Mail_Addresses_File_Path - the pathe where the file with initial addresses list is saved e.g. email_addresses.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dougdogAuthor Commented:
ok so in my csv file do i have 2 columns
1 for the email address im updating column A and Colume B containing all the aliaises?

then open powershell from my computer and run the following command

# .\Over_200_Aliases.ps1 -O365Admin admin@xxxxxx.onmicrosoft.com -O365AdminPassword Password123 -Mailbox_Name mailbox1 -Mail_Addresses_File_Path "C:\Temp\ExoVoice\email_addresses.txt"
0
dougdogAuthor Commented:
just checking what my csv file should contain
0
Saif ShaikhServer engineer Commented:
Why do you need 2 columns. Just put all the names/addresses in a list and paste it in to Excel. Then concatenate the rest of the text on to each line using copy and paste. Save it as a test file with alias_addresses.txt

From power shell with admin right you need to run below command:

E.g.:
# .\Over_200_Aliases.ps1 -O365Admin admin@xxxxxx.onmicrosoft.com -O365AdminPassword Password123 -Mailbox_Name mailbox1 -Mail_Addresses_File_Path "C:\Temp\ExoVoice\alias_addresses.txt"

Where
# O365Admin - Administrator login ID
# O365AdminPassword - Administrator login password
# Mailbox_Name - mailbox with more than 200 aliases
# Mail_Addresses_File_Path - the pathe where the file with initial addresses list is saved e.g. email_addresses.txt
0
dougdogAuthor Commented:
i have 1 mailbox name and 180 aliases
im confused what the text file should look like
0
Saif ShaikhServer engineer Commented:
See the txt file will only have your new aliases updated in it.

Like john@contoso.com

This would be the new alias and when you save it and run the command by connecting to the Office 365 powershell it should update the new email address.

I would recommend first give it a try with only 1-3 alias names saved in it and then run the command: .\Over_200_Aliases.ps1

If it works and alias is updated on the O365 mailbox then you can update all 200 aliases in the txt file and then run the command again.
0
dougdogAuthor Commented:
could you give me an example of what the text file should look like?
0
Saif ShaikhServer engineer Commented:
0
dougdogAuthor Commented:
when i run number 3 command i get

annot bind argument to parameter 'Identity' because it is null.
    + CategoryInfo          : InvalidData: (:) [Set-Mailbox], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Set-Mailbox
    + PSComputerName        : outlook.office365.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.