Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
Exchange Server
Help with moving mailboxes to Exchange 2010
Last Post 26 Jul 2010 10:56 AM by
MaryK
. 5 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
MaryK
Basic Member
Posts:104
20 Jul 2010 12:30 PM
Hello,
I am in the process of moving several hundreds of mailboxes from exchange 2007 to exchange 2010 in batches on 100 a night. The issue is that the move process changed completely in E2k10 from what it was in E2k7. The long story short is that I am working on a script for our helpdesk that will contain the below two lines among others. I need to know when the last mailbox in my batch finished moving so I can issue a command line to export a report.
get-content c:\source.txt | get-mailbox | new-moverequest -targetdatabase databasename
Get-MoveRequest | Get-MoveRequestStatistics | select DisplayName,Status | export-csv c:\report.csv
Karl Mitschke
Basic Member
Posts:451
20 Jul 2010 12:55 PM
You could try somethng like this:
get-content c:\source.txt | get-mailbox | new-moverequest -targetdatabase databasename
do{$waiting = Get-MoveRequest | Where{$_.Status -ne "Completed" -AND $_.Status -NE "Failed"}
}while ($waiting -ne $null)
Get-MoveRequest | Get-MoveRequestStatistics | select DisplayName,Status | export-csv c:\report.csv
http://unlockpowershell.wordpress.com
Co-Author, Windows PowerShell 2.0 Bible
-join("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})
MaryK
Basic Member
Posts:104
21 Jul 2010 05:40 AM
Thanks Karl,
I actually took your suggestion and slightly changed it simply because there are too many states of the mailbox move that might affect the outcome. Let me know if that would work.
do
{
$waiting = Get-MoveRequest | Where{$_.Status -like '*inprogress*' -OR $_.Status -like "*Queued*"}
}while ($waiting -ne $null)
Karl Mitschke
Basic Member
Posts:451
21 Jul 2010 12:55 PM
That should work fine.
Karl
http://unlockpowershell.wordpress.com
Co-Author, Windows PowerShell 2.0 Bible
-join("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})
MaryK
Basic Member
Posts:104
26 Jul 2010 07:44 AM
Hi,
Now the script works fine. However, I would like to refresh the shell screen while the move is happening and display the progress realtime. The problem is that I can't get the formatting of the get-moverequest to display in one line. The results are separate for each mailbox. I would like the result of the request below to show as if you are issuing get-moverequest by itself. Columns and rows.
Thanks
do
{
$waiting = Get-MoveRequest | Where{$_.Status -like '*inprogress*' -OR $_.Status -like "*Queued*"}
Get-MoveRequest | Where { $_.status –eq “InProgress” } | Select DisplayName,PercentComplete | Format-Table –auto
Start-Sleep –seconds 60
}while ($waiting -ne $null)
MaryK
Basic Member
Posts:104
26 Jul 2010 10:56 AM
I may have figured this one out. Out-Default instead of format-table which confilicts with the default output when a script is invoked not from a command line.
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
Exchange Server
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2