Maintain control of your Microsoft 365 data
Post Reply
gec
Lurker
Posts: 2
Liked: never
Joined: Jan 12, 2021 10:08 am
Contact:

Issue with Export-VEXItem for large mailboxes

Post by gec »

Hi,

I'm trying to export all my mailboxes to individual pst through powershell.

I have no issue for small mailboxes. For larger ones, the export-cexitem cmdlet seems to be buggy and the bug seems to be related to the write-progress included in the cmdlet and the initial count item to display this progress bar.
At the start of the export, the cmdlet is counting the items. Then it is processing the export and the pst file is growing. At the end of the progress bar, the export continue, powershell is starting to display errors and the pst continue to grow. I let it ran for a couple hours and the pst were still growing.
To compare, I ran this export for this particular mailbox through the GUI, and the pst is around 15GB. However, it reproduce the "counting" error since the export really finished a couple minutes after the "100%" is displayed.
Image

Here you can see the exporting is getting more items than expected:
Image

Anyone have this issue and know a workaround ? I am also suspecting the particular language of the server.
I tried to disabled the write-progress with: $ProgressPreference = "SilentlyContinue"
but the issue persists.
I also tried with a limit of 10GB without luck.



Some parts of the script:

Code: Select all

import-module Veeam.Archiver.PowerShell
Import-Module -Name AWSPowerShell

Start-Transcript -Path "G:\Export-To-Cloudian\$(get-date -f yy-M-d)-1.log"
$exportDate = "01/01/2020"
$folderExport = $exportDate -replace "/","-"
$restorepoint = Get-VBORestorePoint

$choices = $restorepoint | Where-Object {$_.BackupTime -like "$exportDate*"}

$organization = Get-VBOOrganization -Name "xxxxxxxx"
Start-VBOExchangeItemRestoreSession -RestorePoint $choices[0] -Organization $organization
$session = Get-VBOExchangeItemRestoreSession
$database = Get-VEXDatabase -Session $session
$mailboxes = Get-VEXMailbox -Database $database
$mailboxes | Export-CSV -LiteralPath "G:\Export-To-Cloudian\csv-$($folderExport).csv" -NoTypeInformation -Encoding UTF8
$cpt = -1

#disable bugged progress bar
$OriginalPref = $ProgressPreference # Default is 'Continue'
$ProgressPreference = "SilentlyContinue"

foreach ($user in $mailboxes) {
    $cpt++
    if ($cpt -lt 2) {
        #skip the n first mailboxes (already backuped)
        continue
    }


    # Create folder
    md -Force "G:\Export-To-Cloudian\$folderExport\" | out-null
    # Export PST
    $mailbox = Get-VEXMailbox -Database $database -name $user
    Write-Host "$cpt - Exporting $($mailbox.name) to G:\Export-To-Cloudian\$folderExport\$($mailbox.name).pst"

    Export-VEXItem -Mailbox $mailbox -To "G:\Export-To-Cloudian\$folderExport\$($mailbox.name).pst" -PstSizeLimit 10
    
}

$ProgressPreference = $OriginalPref
Stop-Transcript
Polina
Veeam Software
Posts: 3191
Liked: 774 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: Issue with Export-VEXItem for large mailboxes

Post by Polina »

Hi gec!

Do you have a support case ID on this issue?
gec
Lurker
Posts: 2
Liked: never
Joined: Jan 12, 2021 10:08 am
Contact:

Re: Issue with Export-VEXItem for large mailboxes

Post by gec »

Hi Polina,
No I didn't create a support case yet. I wanted to know through the community if I were alone in this situation before asking to support.

My last test with a specified PstSizeLimit seems to be "better".
The export finished despite a lot of errors. And the size of the two pst generated file seems to be the same as the one generated during the manual export !
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests