Thursday 1 December 2011

Powershell command to move a storage group to a database from exchange 2007 to exchange 2010

Need to move all mailboxes in a  storage group on exchange 2007 to a database on exchange 2010.  Below are a few ways to do it through powershell

get-mailbox -databse "Source Datbase" | New-MoveRequest -TargetDatabase 'target database' -BadItemLimit '25'

The above command creates a move request for all mailboxes in the source database to the target database.

You can also do the same thing by writing the powershell command differently below.

get-mailbox -resultsize unlimited|? {$_.Database -eq "source datbase "} | New-MoveRequest -TargetDatabase 'target datbase' -BadItemLimit '25'

the above command is pretty much saying get mailboxes where the database is set to source and then move it to database that has a name of target.
The one thing about powershell is their are multiple ways to do the same thing.

No comments:

Post a Comment