?
Solved

powershell create array move users different DB exchange

Posted on 2014-07-23
6
Medium Priority
?
395 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
WatchGuard's M Series Appliances - Miecom Approved

WatchGuard's newest M series appliances were put to the test by Miercom.  We had great results and outperformed all of our competitors in both stateless and stateful traffic throghput scenarios! Ready to see how your UTM appliance stacked up? Download the Miercom Report!

 
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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
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…
Suggested Courses

752 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