Forum Discussion

LED04's avatar
LED04
Copper Contributor
Oct 13, 2021

"NeedsApproval"

Hi All,

So I have been migrating mailboxes from onprem to O365 in the hybrid config with no issues.

Today I have two migration batch jobs that state "NeedsApproval", but everything migrated.

Kind of confused as i don't see a way to "approve" the jobs and I don't see any issues.

 

Any ideas?

 

  • Waldis007's avatar
    Waldis007
    Copper Contributor

    LED04 

     

    I realize I'm responding three years later, but I'm engaged in the same battle against a familiar adversary. I've crafted a script that searches for users requiring approval. Upon identifying one or more such users, it proceeds to approve all found. Conversely, if no users are found needing approval, the script waits for 30 seconds before conducting another search. This loop—checking, waiting if necessary, and then acting on any findings—continues, ensuring that the script runs actively for an hour with real-time feedback. Both the frequency of checks and the script's overall runtime are customizable. This approach could prove beneficial for anyone grappling with this persistent challenge.

     

    # Save the start time
    $startTime = Get-Date
    
    # Define the duration to run the script (60 minutes)
    $duration = New-TimeSpan -Minutes 60
    
    # Initialize a counter for the loop iterations
    $iteration = 0
    
    # Run the loop until the current time is less than start time + duration
    while ((Get-Date) -lt $startTime.Add($duration)) {
        # Increase the counter
        $iteration += 1
    
        try {
            # Attempt to get migration users with status 'needsapproval'
            $users = Get-MigrationUser -Status needsapproval -ErrorAction Stop
    
            # Check if there are any users needing approval
            if ($users -and $users.Count -gt 0) {
                # Approve skipped items for users with status 'needsapproval'
                $users | Set-MigrationUser -ApproveSkippedItems -ErrorAction Stop
    
                # Report the number of users who were in 'needsapproval' status and processed
                Write-Host "Iteration ${iteration}: Approved skipped items for $($users.Count) users at $(Get-Date)."
            } else {
                # Report that no users are currently in the 'needsapproval' status
                Write-Host "Iteration ${iteration}: No users in 'needsapproval' status at $(Get-Date)."
            }
        } catch {
            Write-Host "An error occurred during iteration ${iteration}: $_. The script will continue to the next iteration."
        }
    
        # Wait 30 seconds before the next iteration
        Start-Sleep -Seconds 30
    }
    
    Write-Host "Script completed."
  • LadyChiefB17's avatar
    LadyChiefB17
    Copper Contributor
    Hi LED04,

    We found that the "NeedsApproval" was not linked to a person, but a time when the migration would occur. For us, this was 11.30 PM every night. If we left it until this time, it would migrate at this time and show as Completed. For us, though we wanted to kick off the migration sooner, so we changed the migration time and it progressed.

    I am unsure if we used PowerShell or through the GUI, but it showed as completed after this 🙂

    Hope this helps!
    • kantaprasad27's avatar
      kantaprasad27
      Copper Contributor

      I am really fedup of this "Need approval" thing almost on each batch. It is adding no value but eating time on each migration batch/moverequest. I am seeing this even when there are no Corrupt items on move request.

       

      I have been working on migrations since decades and never seen such pathetic experience dealing with this "NEED APPROVAL" even no such bad experience when fixed many failed migration issues. 

      It became worst when I try to fix it through many appreciable solutions provided by community members, but it kicks out the commands with the below error:

       

      Set-MoveRequest -Identity "Emailid" -SkippedItemApprovalTime $(Get-Date).ToUniversalTime()

      Set-MoveRequest -identity "Emailid" -SuspendWhenReadyToComplete $False -PreventCompletion $False -CompleteAfter $CompletionDateTime

       

      WARNING: The request is currently being managed as a part of a migration batch. Changes to the request may be overwritten by the Migration Service or could impact the status expressed by the migration batch or migration user.
      WARNING: The command completed successfully but no settings of 'DB#GBRPxxxG002-dbxxxxxxxxxxx' have been modified.
      WARNING: The request is currently being managed as a part of a migration batch. Changes to the request may be overwritten by the Migration Service or could impact the status expressed by the migration batch or migration user.

       

      is there a way I can Disable this Feature on the Migration Batches and make sure it will not eat unnecessary time on migration Completion?

  • Michal_Radix's avatar
    Michal_Radix
    Copper Contributor

    Hi maybe this reply is quite late but for future cases:
    - Open powershell
    - Use the Connect-ExchangeOnline command (google how to download and use)
    - Use CMD:

    Spoiler
    Set-MigrationUser -Identity "email address removed for privacy reasons" -ApproveSkippedItems​

    Or CMD:

    Set-MoveRequest -Identity email address removed for privacy reasons -SkippedItemApprovalTime $(Get-Date).ToUniversalTime()


    This worked for me 🙂

  • mohdazwan79's avatar
    mohdazwan79
    Copper Contributor
    The Status indicated "Need Approval", you can check users license apps for their application, make sure you tick Exchange Online (Plan XX). Anyway the completion of migration resume as usual, It will change status when completing migration completed
    • LED04's avatar
      LED04
      Copper Contributor
      Um no, this just explains the skippped items threshhold. This is the first time I'm seeing this message and I have migrated at least 250 users across five batches. They all had good or perfect scores as these did but this is a first as it I've ever seen this message before.
      • JeffDtechwizzard's avatar
        JeffDtechwizzard
        Copper Contributor

        I'm  also getting this with every mailbox/batch we run. It says needs approval with no option to approve. Eventually it moves to completed and the mailboxes are migrated. I have opened a case with Microsoft. LED04 

  • LED04's avatar
    LED04
    Copper Contributor
    Ok so now after a while they are all "Completed" so is this just a new message during the completion process?

Resources