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
Solved

powershell create array move users different DB exchange

Posted on 2014-07-23
6
380 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
  • 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 70

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 70

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create a User 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 >> Mailb…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

792 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