Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵兆

當您使用遠端 PowerShell Microsoft Exchange Online腳本或 Cmdlet 來修改大型資料集時,您可能會遇到下列其中一種或兩種症狀:

  • 腳本或 Cmdlet 需要很長的時間執行。

  • 在 PowerShell 中,您Exchange Online節流警告訊息:

    警告:已應用微型延遲。 實際延遲:<X>毫秒, ...
    警告:已應用微型延遲。 實際延遲:<X>毫秒,已強制執行

原因

產生此錯誤是系統刻意為之。 節流是用來防止對服務進行惡意或無意攻擊,可能會影響服務等級協定。 您可以放心地忽略警告訊息。

因應措施 

若要處理此行為,請嘗試下列以給定順序顯示的選項。

選項 1

在系統管理中心執行自助診斷Microsoft 365更新租使用者Exchange遠端 PowerShell 節流政策。 有關詳細資料,請參閱在 Exchange Online 和 Outlook中Exchange Online診斷

選項 2

使用 Exchange Online PowerShell V2 Cmdlet 執行這項工作。 詳細資料請參閱關於 PowerShell V2 Exchange Online>模組。

選項 3

在腳本或 Cmdlet 中新增下列睡眠元素。 此元素會讓腳本或 Cmdlet 在節流限制的邊界內變慢。


Start-Sleep -m <Time in milliseconds>
在下列範例中,使用 Cmdlet Get-Mailbox 的信箱清單會儲存在變數中。 此變數用於在所有信箱上執行動作。 這類工作通常會受到限制。 將睡眠元素新增到 Cmdlet,您可以嘗試維持在節流限制的邊界內。

$MB=get-mailbox -resultsize unlimited $MB | %{Set-Mailbox $_.identity -CustomAttribute8 "Test"; Start-Sleep -m 500}

選項 4

使用 RobustCloudCommand 模組執行腳本或 Cmdlet。 您可以使用內建的 Cmdlet Install-Module 模組。

以下是使用 RobustCloudCommand 模組新增許可權至多個公用資料夾之程式範例:

  1. 請用下列 Cmdlet 將公用資料夾清單匯出至PFList.csv
    檔案:Invoke-Command -Scriptblock {Get-PublicFolder -Recurse -Resultsize Unlimited | Select-Object -property Name,Identity} -Session (Get-Pssession) |Export-csv -Path C:\Temp\PFList.csv -NoTypeInformation

  2. 請用下列 Cmdlet 安裝 RobustCloudCommand 模組

    Install-Module -Name RobustCloudCommand -Force

  3. 執行下列 Cmdlet,將步驟 1產生的公用資料夾清單$PFList到$PFList = Import-Csv C:\Temp\PFList.csv

  4. 執行下列 Cmdlet,$PFList變數 每個公用資料夾的許可權。 此 Cmdlet 會建立 LogFileName 記錄,其中包含 Cmdlet 詳細資料,以及可能會發生的任何錯誤。

    Start-RobustCloudCommand -LogFile C:\Temp\LogFileName.log -Recipients $PFList -ScriptBlock {Add-PublicFolderClientPermission -Identity $input.identity.tostring() -User User@Contoso.com -AccessRights CreateItems} -IdentifyingProperty Identity -UserPrincipalName Admin@contoso.com

附註: 根據修改的物件數量,這些 Cmdlet 通常會執行數小時或甚至數天。

其他相關資訊

是否仍需要協助? 前往 Microsoft Community

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×