Exchange Management Shell move command?
Hi everyone (Exchange 2007 SP1 on Windows 2008) I'm going to be moving over 600 mailboxes over the next 2 days, and I was hoping someone might be able to advise as to the best way to "manage" the migration window. I have my process ready in that I have created a command in a ps1 file, tested it, created a scheduled task and tested this and it seems to work fine. However, in order to prevent the migrations "over-running" during the night I have thus far only tested terminating the "moves" by using the Task Scheduler (setting the task to terminate after 2 hours for instance). This seems a little crude. When I set the Windows task to terminate, I can see that Exchange does "rollback" the mailbox being moved, but there are also event log warnings about "rule synchronisation" issues for instance, likely referring to the mailbox that was in transit. Any ideas on how to manage this "termination" gracefully?
March 29th, 2010 7:32pm

If you script is something like: move-mailbox <from> <to>move-mailbox <from> <to>move-mailbox <from> <to> You could check the time before each move like: if ((get-date).Hour -lt 12){move-mailbox <from> <to>}if ((get-date).Hour -lt 12){move-mailbox <from> <to>}if ((get-date).Hour -lt 12){move-mailbox <from> <to>} If you have a function, and pass the mailbox name and target, you could do it at the beginning of your function like: Function MailMove{if ((get-date).Hour -gt 12){break}move-mailbox <from> <to>} Karlhttp://unlockpowershell.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2010 8:04pm

Hmm, Well my script is quite simple in that I use the get-content cmdlet (already retrieved windowsemailaddress), then pipe to foreach-object {movemailbox blah}, so very basic.
March 29th, 2010 8:18pm

im doing the basically the same thing, any chance you'd willing to share the script ?
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2010 8:48pm

Millardus, There are a couple of ways to review mailbox move information. I think the best tool to monitor the mailbox move is using the migration logs. You can find this information by default in C:\Program Files\Microsoft\Exchange Server\Logging\MigrationLogs. For more information check out some of my posts http://cbfive.com/blog/page/Move-Mailbox.aspx http://cbfive.com/blog/post/Mailbox-Move-Script.aspx Chaz1121, You are welcome to use the move mailbox script that I wrote from the blogs above but, it might be more complex than needed. Microsoft has provided a good script that might meet you needs, if it doesn’t let me know. http://technet.microsoft.com/en-us/library/dd876878.aspx Chris cbfive.com
March 29th, 2010 9:23pm

thanks, that'll do. much obliged.
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2010 9:33pm

Thanks CCran I think the output file and script I've got will do the job, but I have rather strict timescales in which do do this overnight i.e. 0100 - 0700 (i.e. I wont be monitoring it at work), so I wanted to see if I could find a way of "gracefully" ending a move that was running according to a scheduled task. i.e. if at 07:00am 7 mailboxes are still being moved I would need to have them "rollback", the question is how do I get that into a script (Or will cancelling the windows scheduled task be acceptable...) Is it simply a matter of trying to get the "calculation" as precise as possible and then creating an input file with the "correct" amount of mailboxes? What I'm actually trying to ensure is that when I'm scheduling the larger mailboxes i.e. 500mb to 1GB, I don't end up running the task all the way to 0700 and then a mailbox which is 90% finished has to rollback. Am I being naive and this amount of precision is just not possible?
March 30th, 2010 12:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics