Actually, this is more of a question than answer – although I have an answer of sorts, albeit far from elegant.
I’ve been scheduling some batch onboarding mailbox migrations from a hybrid environment with Exchange 2010 to Exchange Online. The batch process is pretty straightforward, but I haven’t found an easy way to dump the list of users within the batch after it has been created. Of course if you are using the CSV import method of populating the batch this is a bit of a non-issue. However, if you’re creating the batch manually you might want to check back in at some point and remind yourself who is in the batch – or you might want to export the list to send to someone else. Now I’m not entirely new to Powershell, but I can’t see any obvious way to do this easily. Here’s what I ended up with:
(Get-MigrationBatch -Identity “MyBatchName” -IncludeReport | select -ExpandProperty report).entries.message.formatparameters | ?{$_ -like “*@*”}
Ugly, isn’t it? The above command will provide a list of email addresses of the mailboxes within the batch.
If you have found an easier way of doing this, please post a comment below.
You can achive the same goal with less Code: Get-MigrationUser -BatchId “yourBatchname”. This will give you all the mailboxes in the Batch. Normale the Name of the migrationuser is the email Address of the Mailbox… Cheers Christian
Thanks Christian. I knew there had to be an easier way!
I actually managed to find an even uglier method too:
Get-Recipient -ResultSize unlimited | ? {$_.mailboxmovebatchname -like “MigrationService:MyBatchName”}
I like yours much better 😉
These don’t work if the batch has not been started… But the info must be there somewhere. I’ve manually created various batches and want to check I have the right people in them immediately before starting them…
Thank you for article, unfortunately no one of three methods give you mailbox list BEFORE you start batch.