none
Не работает автоматическая выгрузка (скрипт) почтовых ящиков Exchange 2010 sp2 по всему лесу в PST RRS feed

  • Вопрос

  • Камрады добрый день, подскажите кто в курсе, нашел в инете скрипт выгрузки почты в файл (см ниже), но он почему то не цепляет ящики пользователей на дочернем домене в лесу :( А из домена где находится сам почтовый сервер выгрузка идет без проблем! Т.е. есть пример, домен mydomen.local в нем почтовик MAIL.mydomen.local и есть дочерний домен doc.mydomen.local. 

    Скрипт запускаю непосредственно с почтового сервера  MAIL.mydomen.local

    Вот листинг скрипта:

    # Exchange 2010 SP1 Mailbox Export Script
    # Steve Goodman. Use at your own risk!

    ###############
    # Settings #
    ###############
    #Add Exchange features.
    #Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

    # Pick ONE of the two below. If you choose both, it will use $Server.
    $Server = "MAIL"
    $Database = ""

    # Share to export mailboxes to. Needs R/W by Exchange Trusted Subsystem
    # Must be a UNC path as this is run by the CAS MRS service.
    $ExportShare = "\\dc\PST\test"

    # After each run a report of the exports can be dropped into the directory specified below. (The user that runs this script needs access to this share)
    # Must be a UNC path or the full path of a local directory.
    $ReportShare = "\\dc\PST\test"

    # Shall we remove the PST file, if it exists beforehand? (The user that runs this script needs access to the $ExportShare share)
    # Valid values: $true or $false
    $RemovePSTBeforeExport = $false

    ###############
    # Code #
    ###############

    if ($Server)
    {
    if (!(Get-ExchangeServer $Server -ErrorAction SilentlyContinue))
    {
    throw "Exchange Server $Server not found";
    }
    if (!(Get-MailboxDatabase -Server $Server -ErrorAction SilentlyContinue))
    {
    throw "Exchange Server $Server does not have mailbox databases";
    }
    $Mailboxes = Get-Mailbox -Server $Server -ResultSize Unlimited
    } elseif ($Database) {
    if (!(Get-MailboxDatabase $Database -ErrorAction SilentlyContinue))
    {
    throw "Mailbox database $Database not found"
    }
    $Mailboxes = Get-Mailbox -Database $Database
    }
    if (!$Mailboxes)
    {
    throw "No mailboxes found on $Server"
    }

    if (!$Mailboxes.Count)
    {
    throw "This script does not support a single mailbox export."
    }

    # Pre-checks done

    # Make batch name
    $date=Get-Date
    $BatchName = "Export_$($date.Year)-$($date.Month)-$($date.Day)_$($date.Hour)-$($date.Minute)-$($date.Second)"

    Write-Output "Queuing $($Mailboxes.Count) mailboxes as batch '$($BatchName)'"

    # Queue all mailbox export requests
    foreach ($Mailbox in $Mailboxes)
    {

    if ($RemovePSTBeforeExport -eq $true -and (Get-Item "$($ExportShare)\$($Mailbox.Alias).PST" -ErrorAction SilentlyContinue))
    {
    Remove-Item "$($ExportShare)\$($Mailbox.Alias).PST" -Confirm:$false
    }
    New-MailboxExportRequest -BatchName $BatchName -Mailbox $Mailbox.Alias -FilePath "$($ExportShare)\$($Mailbox.Alias).PST"
    }

    Write-Output "Waiting for batch to complete"

    # Wait for mailbox export requests to complete
    while ((Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"}))
    {

    sleep 60
    }

    # Write reports if required
    if ($ReportShare)
    {
    Write-Output "Writing reports to $($ReportShare)"
    $Completed = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq "Completed"} | Get-MailboxExportRequestStatistics | Format-List
    if ($Completed)
    {
    $Completed | Out-File -FilePath "$($ReportShare)\$($BatchName)_Completed.txt"
    }
    $Incomplete = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -ne "Completed"} | Get-MailboxExportRequestStatistics | Format-List
    if ($Incomplete)
    {
    $Incomplete | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete_Report.txt"
    }
    }

    # Remove Requests
    Write-Output "Removing requests created as part of batch '$($BatchName)'"
    Get-MailboxExportRequest -BatchName $BatchName | Remove-MailboxExportRequest -Confirm:$false


    • Изменено skodamax 27 февраля 2013 г. 11:24
    27 февраля 2013 г. 11:22

Ответы

Все ответы