Solved

powershell create array move users different DB exchange

Posted on 2014-07-23
6
383 Views
Last Modified: 2014-08-21
I am trying to move users from one version 2007 to 2013 of Exchange to another. I am doing this from a migrationbatch. The problem is I am wanting them to spread across databases and heard I can do this with an array. I also honestly do not have a strong understanding of arrays. Can someone help me please. How would I incorporate an array into this command so that for each user in the csv file this can run and put them on different databases in the DAG, thanks

$dag2013_DBs = get-mailboxdatabase | where {$_.name –like “DAG2013*”}

New-MigrationBatch -Local -Name MigrationBatch1 -CSVData ([System.IO.File]::ReadAllBytes("E:\Migration\MigrationBatch1.csv")) -TargetDatabases $DAG2013_DBs –AutoStart –BadItemLimit  100 –AutoRetryCount 3  –NotificationEmails
0
Comment
Question by:techdrive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 37

Expert Comment

by:Jamie McKillop
ID: 40217311
Hello,

If you want to spread the mailboxes across your databases, just excluded the -TargetDatabases switch. Exchange will randomly distribute the mailboxes across the databases.

-JJ
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 40217315
An array is just a list of stuff. What the stuff actually is is entirely up to you. In this case you've potentially created an array of your mailbox databases.

However, the TargetDatabases parameter expects an array of strings, just database names. What you're giving it at the moment is a bit more complex than that. Are you finding it doesn't much like it?

If so, this should drop you down to just a name:
$dag2013_DBs = Get-MailboxDatabase | Where-Object { $_.Name -like  "DAG2013*" } | ForEach-Object { $_.Name }

Open in new window

It takes your current filtered list, and instead of holding onto everything it knows about the database it trims that down to just the database name (a string).

Given that I haven't used New-MigrationBatch (or Exchange 2013 for that matter) I can't comment too much on specific usage. Still, yell if it's not doing what you expect, I'm sure it can be encouraged :)

Chris
0
 

Author Comment

by:techdrive
ID: 40217569
thanks for the help but JJMCK but it is not distributing them evenly. Also thanks Chris Dent for your explanation as well.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 37

Expert Comment

by:Jamie McKillop
ID: 40217599
It randomly selects a database. The smaller the number of mailboxes you have, the less likely they will be evenly distributed. By using the -TargetDatabases switch it will also select randomly. It will just select from the list you provide instead of from all the available databases. If you want to evenly distribute the mailboxes, you will need to script that instead of using the New-MigrationBatch command.

-JJ
0
 

Author Comment

by:techdrive
ID: 40238095
I know exchange 2013 h capability to do this but I wanted to do this in powershell. Can anyone help?
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 40238374
To balance the mailboxes across the stores?

You know you won't be able to use the batch migration tool?

And if you're balancing, what criteria? My last attempt doing this simply shoved new users in the smallest available store. I've yet to find a method that really stands the test of time.

Chris
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In-place Upgrading Dirsync to Azure AD Connect
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question