Link to home
Start Free TrialLog in
Avatar of isakabir
isakabir

asked on

How to move multiple mailbox to different DB simultaneously using Exchange powershell ?

I have around 50 mailbox to  move and each one of them goes to different database. I would like to make 5 lists of 10 mailbox and run it from differnt server. Hence I would open 5 powershell window. From each window I would only like to use MAX THREAD 5.
 
If I use the below command it would only allow me to move the list of users one specific DB. As a result I have to keep changing DB name and list of user all the time which I dont want.

Get-Content userlist.txt | Get-Mailbox | Move-Mailbox -TargetDatabase 'EX2K7\First Storage Group\Mailbox Database' -MaxThreads 5

If I use the below  command I don't have to specify users and DB name all the time, but the problem is that I am not able to use 5 thread in one window. It only moves one mailbox after another. So mailbox move would take long time.

Import-CSV move.csv | ForEach {Get-Mailbox $_.alias | Move-Mailbox -TargetDatabase $_.TargetDB -PreserveMailboxSizeLimit:$true -Confirm:$False}

[move.csv contains alias,Database]

The above statement only works for single-threaded move-mailbox. I have even tried even - MAXTHREADS 5 in the above command. It does not work. Only one mailbox moves at one time. Then the next one.

Can anyone please help me by giving me a script or command ? How can I use multi threading  to move mailbox in different DB without changing list of users or input file?

Any kind of help would be highly appreciated.

Thanks in Advance!




Avatar of Andres Perales
Andres Perales
Flag of United States of America image

Why don't you use the move mailbox wizard from ESM and schedule those things to move at different times?
http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/moving-mailboxes-exchange-2007-part1.html 
 
Avatar of isakabir
isakabir

ASKER

Thanks for  your reply. This does not  help me because I can not schedule move in different time. I need to move all these mailbox within a very short perios of time. That's why I have to utilize multi threading and it will help me to move mailbox simultaneously. Moreover, using move mailbox wizard of colsole (EMC) is not efficient enough  for large amount of mailbox. I need a efficient way to move mailboxe.

 Any more thoughts?

Thanks in advance!
 
In this case single command line won't work. We have to write a script with arrays.

I hope the script in this link might help you..
http://blogs.technet.com/benw/archive/2008/06/02/move-mailbox-from-a-csv-import-file.aspx

- Cheers!
Your reasons for using a script are incorrect.
The move mailbox wizard in EMC allows you to select multiple mailboxes, it is fully multi threaded and allows you to schedule the move. I have moved 1000s of mailboxes using Move Mailbox. You need to look at the wizard again, as it will do everything that you have asked for.

Simon.
If I use  EMC I can not choose different destination DB for 100 mailboxes at once. This wizard is  good when I want to move 100 DB to a same destination DB. Correct me if I am wrong. Moreover; use filering to find out which are the alias need to be moved contains lot of manual work.
ASKER CERTIFIED SOLUTION
Avatar of Mestha
Mestha
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial