Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create Alias in Office 365

Posted on 2016-10-04
7
27 Views
Last Modified: 2016-10-26
Hello Experts,
I have few requirements:
1. I have Primary emails created in O365: user@abc.com
2. I want to export the list of all users in O365 with their Email addresses.
3. I want to create Alias's for all the user, which will be more than 1 e.g. user.name@abc.com & user@xyz.com & user.name@xyz.com
 In the above step there is a different Domain name also, i have the accepted domain already staged.
4. Also, I want to delete the .onmicrosoft.com for all users (if possible)

I would prefer if I can export the existing users in csv, then update different columns with Alias's & then update via powershell calling updated csv.

Thanks a lot in advance for your kind help.
Regards,
A
0
Comment
Question by:Ackles
  • 5
  • 2
7 Comments
 
LVL 40

Expert Comment

by:Vasil Michev (MVP)
ID: 41827814
You can append/delete to/from the list of aliases easily, for example:

Set-Mailbox user -EmailAddresses @{add="new@domain.com"}

Open in new window


The above cmdlet will add new@domain.com as alias for user's mailbox, while preserving all the existing ones. So there should be no need to mess with CSVs.

Same goes for the default onmicrosoft address. I'd recommend against removing it, but if you really want to do it you can use the same format with the "remove=" operator.

This will only work if you have the users provisioned directly in the cloud though, if you are using dirsync the changes need to be made on-prem.
0
 
LVL 11

Author Comment

by:Ackles
ID: 41827821
Thanks
But as you see in my example i have other criteria also
Example the user name is John@abc.com
Alias
Jj@ abccom
Jj@xyz.com
John@xyz.com

How would it be possible with this script?
0
 
LVL 40

Expert Comment

by:Vasil Michev (MVP)
ID: 41827848
You can add multiple aliases using the same method, and you can easily build new ones based on user's attributes. For example, this will add an alias based on the user's first and last name:

Get-user user | % { Set-Mailbox $_.Identity -EmailAddresses @{add=$($_.FirstName + "." + $_.LastName + "@domain.com")} }

Open in new window


If you remove the actual user, the above example can also be run against the full list (or a subset) of users, and will add the firstname.lastname@domain.com alias for all of them. Which for me is way better method than doing it manually via CSV.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 11

Author Comment

by:Ackles
ID: 41827865
Thanks Vasil,
Let me try to explain again....
As for the first & last name it's fine, but we have some special internal names (as illustrated in earlier example "jj@abc.com & jj@xyz.com"
Because of this the above listed script won't suffice the need.

So that's why I was looking for csv method.....
0
 
LVL 11

Author Comment

by:Ackles
ID: 41827966
I found this script on o365info.com
$Users = Import-CSV C:\TEMP\book1.csv $Users | ForEach {Set-Mailbox $_.UserID -EmailAddresses $_.NewAddress,$_.UserID,$_.Proxy1}

They also provide a CSV, however the issue is that it's not working for the exiting users...
Screen-Shot-2016-10-04-at-14.54.50.png
0
 
LVL 11

Accepted Solution

by:
Ackles earned 0 total points
ID: 41827972
Got it!!!
This is what i did:

1: $Users = Import-CSV C:\TEMP\book1.csv
2. $Users | ForEach {Set-Mailbox $_.UserID -EmailAddresses @{add = $_.UserID,$_.Proxy1,,$_.Proxy2,,$_.Proxy3}}

& it worked!!!
0
 
LVL 11

Author Closing Comment

by:Ackles
ID: 41859957
Worked as desired
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
how to add IIS SMTP to handle application/Scanner relays into office 365.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question