Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Create Alias in Office 365

Posted on 2016-10-04
7
Medium Priority
?
69 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
[X]
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
  • 5
  • 2
7 Comments
 
LVL 43

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 43

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Are your AD admin tools letting you down?

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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