Move-Mailbox using data from a .cvs ?
I need to move some users from one DataStorage to another and i have all those users in a .cvs file, anyone with a solution? or do i have to move all the users manually via EMS ?Ariel Antigua | MCSA:Messaging | http://blog.arielantigua.com
August 12th, 2009 7:17pm

What is the structure of the csv file?it's possible you can do something like this:$users = Get-Content nameof.csvForEach ($user in $users){Move-Mailbox -Identity $user -TargetDatabase <database to move to>}Test this on a test environment first.Karl
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2009 7:24pm

Ok, i will do some test and post back...I dont have the CVS file yet.. but i think it will be a one user per line.user1user2something like that.. Ariel Antigua | MCSA:Messaging | http://blog.arielantigua.com
August 12th, 2009 7:30pm

You can also add reporting function also on the status of mailbox move status... PowerShell Script: Move Mailboxes From Exchange 2003 to Exchange 2007 http://exchangeshare.wordpress.com/2007/11/20/powershell-script-move-mailboxes-from-exchange-2003-to-exchange-2007/Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2009 7:31pm

Hi,You can see below thread, You can use CSV file as input in cmdlet and pipe those user list with move-mailbox command.https://blogs.wharton.upenn.edu/bubblewrap/2008/05/how-to-move-mailboxes-from-a-t.htmlAnil
August 12th, 2009 7:37pm

The file extention you mentioned should be CSV, but not CVS...Karl's suggestion could do the trick, modified one incorrect item:$users = Get-Content nameof.csvForEach ($user in $users){Move-Mailbox -Identity $user -TargetDatabase <database to move to>}Thanks,Elvis
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2009 9:40am

Hi, Assuming that you are moving users from one server (Exchange 2k3 or 2k7) to another (Exch 2k7) or one DB to another in the same Org. Please follow the steps... 1. For those users take the displayname, or Alias or UPN and paste one in each line of CSV file (MS Excel) and save it as CSV file. 2. To test the validity of each entry of these users in CSV file run the following command in PS. Get-Content [path of CSV file] | foreach {Get-Mailbox} 3. if error with any entry, check that entry and correct it in CSV. if no error then then use following commands to move mailbox from Source DB to Target DB. Copy the commands and paste it in notepad and then save it as MB-Moves.ps1 in some location. Identity of target DB can be found with following command... Get-mailboxdatabase -server [server name] | fl Name, Identity . Copy the Identity and paste it in the code. $List = Get-Content "["Path of CSV file"] | Get-Mailbox | Foreach {$_.Alias} $List | Move-Mailbox -TargetDatabase [Identity of target DB] -Maxthread 5 -BadItemLimit 500 -IgnoreRuleLimitErrors -PreserveMailboxSizeLimit -confirm:$false This command will move 5 mailboxes at a time. By Default the Report is saved in Logging "C:\Program Files\Microsoft\Exchange Server\Logging\MigrationLogs\*.xml" where the XML will be named with with current date. XML files can used to generate the reports of moves. 4. Once completed, you can Verify the moves by following command. Get-Content [path of CSV File] | Get-Mailbox | ft Displayname, Servername, Database note the server and database for all users which should be now the target DB. sometime it depends on number of domain controllers you have in your environment. so it better if run this command after 15 mins to 30 mins depending on your moves. Let me know how it goes. Thanks.Vishal Ramnani | MCITP - Exchange 2007 | MCSE Messaging | MCTS - Win 2008 Config
August 14th, 2009 11:02am

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

Other recent topics Other recent topics