powershell change completeafter for a batch of moverequests
- User
powershell change completeafter for a batch of moverequests
Assistant
Changing the
CompleteAfterValue for a Batch of Move Requests in PowerShellTo change the
CompleteAfterparameter for a batch of mailbox move requests in Exchange (on-premises or Exchange Online), you can use PowerShell to automate the process. TheCompleteAfterparameter controls when a move request is allowed to complete, which is useful for scheduling mailbox cutovers to minimize user impact[2][4].How to Change
CompleteAfterfor Multiple Move RequestsYou can use the
Set-MoveRequestcmdlet in combination withGet-MoveRequestto update theCompleteAfterproperty for a batch of move requests. Here’s a step-by-step approach:1. Identify the Move Requests
You can filter move requests by batch name, status, or other criteria. For example, to get all move requests in a specific batch:
Get-MoveRequest -BatchName "YourBatchName"2. Set the
CompleteAfterValueTo set the
CompleteAftervalue for each move request, use aForEach-Objectloop. The value can be a specific date/time in UTC or the current time to complete immediately.Example: Set
CompleteAfterto a specific UTC time for all move requests in a batch$completeAfter = (Get-Date "2025-05-07 02:00:00").ToUniversalTime() Get-MoveRequest -BatchName "YourBatchName" | ForEach-Object { Set-MoveRequest -Identity $_.Identity -CompleteAfter $completeAfter }This schedules all move requests in the batch to complete after the specified time[1][2][4].
Example: Complete all move requests immediately
Get-MoveRequest -BatchName "YourBatchName" | ForEach-Object { Set-MoveRequest -Identity $_.Identity -CompleteAfter 1 }Setting
-CompleteAfter 1triggers immediate completion[3][5].3. Verify the Changes
You can verify the
CompleteAftervalue for each move request:Get-MoveRequest -BatchName "YourBatchName" | Get-MoveRequestStatistics | Select DisplayName, CompleteAfterAdditional Notes
- If the move request is stuck in a suspended state (e.g.,
SuspendWhenReadyToCompleteis$true), you may also need to set-SuspendWhenReadyToComplete:$falseand-PreventCompletion:$falsebefore resuming the move[5]. - For move requests with bad items, you might need to approve skipped items using the
-SkippedItemApprovalTimeparameter[8]. - The
CompleteAfterparameter expects a UTC time. Use.ToUniversalTime()to convert local times as needed[2][4].
Sample Script for Bulk Update
$batchName = "YourBatchName" $completeAfter = (Get-Date "2025-05-07 02:00:00").ToUniversalTime() Get-MoveRequest -BatchName $batchName | ForEach-Object { Set-MoveRequest -Identity $_.Identity -CompleteAfter $completeAfter }This script updates all move requests in the specified batch to complete after the given UTC time.
Summary:
UseGet-MoveRequestto select your batch, then pipe toSet-MoveRequest -CompleteAfterto update the completion timing for all move requests in that batch. This approach is efficient and fully supported in both on-premises Exchange and Exchange Online environments[1][2][4].- If the move request is stuck in a suspended state (e.g.,
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.