我的情况是,当我想要将几个邮箱排入队列以导出(我不希望它们同时被处理)到PST文件。我知道如何使用get-mailboxexportrequest命令导出它们,但当我这样做时,它们几乎立即就开始了。我可以以某种方式排队另一个邮箱,以便它将自动启动,当前一个邮箱完成时?
发布于 2017-10-13 16:08:30
我会做以下事情:
更新:
作为一个起点,像下面这样的东西应该很好(未经测试,但应该给你一个起点):
# Get current Export Requests
$ExportStats = Get-MailboxExportRequest
#Check if there are completed questes
If ($ExportStats.Status -eq "Completed")
{
Write-Host "Export done"
Get-MailboxExportRequest -Status Completed -Name "$ObjectName-Export" | Remove-MailboxExportRequest -Confirm:$false
#Disable-Mailbox -identity "AD\$ObjectName"
# Create a new CSV file, which isn´t including the current export name we just marked as finish via above's section.
# CODE MISSING HERE!
# Now import our CSV list and proceed it
Import-CSV <Filepath of CSV file(\\server\folder\file.csv)> | ForEach-Object {
# Perform the export
New-MailboxExportRequest -Mailbox $_.MailboxAlias -FilePath $_.PSTpath
New-MailboxExportRequest -Mailbox $_.MailboxAlias -FilePath $_.ArchivePath
# Once done exit here, this will ensure we proceed only the first entry
Exit
}
}
elseif ($ExportStats.Status -eq "InProgress")
{
Write-Host "Export still ongoing"
}https://stackoverflow.com/questions/46688071
复制相似问题