Solved

Powershell Scripts for Office 365 Migartion

Posted on 2014-10-09
3
553 Views
Last Modified: 2014-10-15
I am migrating 18 domains from one office365 Tenancy to another.
Let's call them T1 [source] and T2 [destination]. I have migrated smaller domains first to test and have ran into some changes which are fine with only 3-4 users per domain, but when i have 200 user domain migration i will need some automation and good Powershell scripts to help. To date I have gathered a lot of useful scripts, but am not sorely missing the following... Any ideas where or what i can do to get them ?

Remove Vanity domain from any user with it as an alias or Primary domain.#

Bulk Purge all "deleted contacts" or at least bulk delete from CSV.

Assign Vanity domain from CSV, ideally setting as either Primary or Alias.
0
Comment
Question by:paologiorgio
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Vasil Michev (MVP) earned 500 total points
ID: 40370945
I think it's better if you do the first part manually, as there are probably too many factors you need to account for. For example, does the user have more than one address, are the secondary aliases in usable format (i.e. will he end up with something like tfdsfhsd@domain.onmicrosoft.com), which one to set up as primary if the primary is removed, etc. You can easily get a list of all the objects that have such aliases, the removal part is what worries me.

 Get-Recipient -Filter {EmailAddresses -like "*domain.com"}

Open in new window


Contacts are 'special case' with WAAD, you can only list them by using objectId or searchstring. If you remove them, they dont go to the recycle bin, so can you clarify what you mean by "deleted contacts"? Perhaps the objects in your case are mailusers?

For adding the new alias, probably the easiest way is to run:
Set-Mailbox user@domain.com -WindowsEmailAddress new@newdomain.com

Open in new window


This will add new@newdomain.com alias, make it primary and preserve user@domain.com as secondary. So you can just pass the CSV imported objects to it.
0
 

Author Comment

by:paologiorgio
ID: 40370988
Vasil,

Thanks for Reply.

By deleted contacts i mean, i deleted the contact asmith@contoso.com in T2 and they were no longer present in contacts in exchange admin. I thought that it was gone for good.

I then went to add the vanity domain contoso.com (recently verified on T2) to the user asmith (a user with a license) and it threw up the error about the name already exists.

I presumed the contacts had not flushed and went about purging contacts. When i searched for mailcontact containing "asmith" i found my culprit, using the unique ID i forced deletion.

I was then able to add domain and turn my contact essentially into a mailbox.
0
 
LVL 38

Expert Comment

by:Vasil Michev (MVP)
ID: 40371001
Hm, maybe you can try deleting it from WAAD instead of EO, using the Remove-MSOLContact cmdlet. Probably when you remove it from Exchange first it waits for replication, thus the delay you experienced.

Edit: just deleted a test contact from WAAD and immediately created another one with the same email address, no issues.

Repeated the same procedure by deleting the contact from EO instead, again no issues after I recreated it. Strange...
0

Featured Post

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Microsoft Office Picture Manager has a Picture Shortcuts pane that shows a list with the Recently Browsed folders. While creating my video Micro Tutorial here at Experts Exchange showing How to Install Microsoft Office Picture Manager in Office 2013…
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…

708 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

12 Experts available now in Live!

Get 1:1 Help Now