header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Help with moving mailboxes to Exchange 2010
Last Post 26 Jul 2010 10:56 AM by MaryK. 5 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
MaryKUser is Offline
Basic Member
Basic Member
Posts:104
Avatar

--
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 MitschkeUser is Offline
    Basic Member
    Basic Member
    Posts:451
    Avatar

    --
    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$_"})
    MaryKUser is Offline
    Basic Member
    Basic Member
    Posts:104
    Avatar

    --
    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 MitschkeUser is Offline
    Basic Member
    Basic Member
    Posts:451
    Avatar

    --
    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$_"})
    MaryKUser is Offline
    Basic Member
    Basic Member
    Posts:104
    Avatar

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



    MaryKUser is Offline
    Basic Member
    Basic Member
    Posts:104
    Avatar

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


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer