Solved

Create Alias in Office 365

Posted on 2016-10-04
7
15 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 38

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 38

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now