Set-SPDiagnosticConfig
設定伺服器陣列的診斷組態設定。
Syntax
Set-SPDiagnosticConfig
[-AllowLegacyTraceProviders]
[-AppAnalyticsAutomaticUploadEnabled]
[-AssignmentCollection <SPAssignmentCollection>]
[-CustomerExperienceImprovementProgramEnabled]
[-DaysToKeepLogs <Int32>]
[-DownloadErrorReportingUpdatesEnabled]
[-ErrorReportingAutomaticUploadEnabled]
[-ErrorReportingEnabled]
[-EventLogFloodProtectionEnabled]
[-EventLogFloodProtectionNotifyInterval <Int32>]
[-EventLogFloodProtectionQuietPeriod <Int32>]
[-EventLogFloodProtectionThreshold <Int32>]
[-EventLogFloodProtectionTriggerPeriod <Int32>]
[-InputObject <PSObject>]
[-LogCutInterval <Int32>]
[-LogDiskSpaceUsageGB <Int32>]
[-LogLocation <String>]
[-LogMaxDiskSpaceUsageEnabled]
[-ScriptErrorReportingDelay <Int32>]
[-ScriptErrorReportingEnabled]
[-ScriptErrorReportingRequireAuth]
[<CommonParameters>]
Description
使用 Cmdlet Set-SPDiagnosticConfig
在整個伺服器陣列上設定診斷組態設定。
如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet。
範例
------------------範例 1-----------------------
Set-SPDiagnosticConfig -ErrorReportingEnabled -DownloadErrorReportingUpdatesEnabled:$false -DaysToKeepLog 60
此範例會啟用 ErrorReporting、停用 DownloadErrorReportingUpdatesEnable,並將 DaysToKeepLog 設定為 60。
------------------範例 2-----------------------
$config = Get-SPDiagnosticConfig
$config.CustomerExperienceImprovementProgramEnabled = $false
$config.LogCutInterval = 60
$config | Set-SPDiagnosticConfig
此範例會停用 CEIP,並將 LogCutInterval 設為 60 分鐘。
參數
-AllowLegacyTraceProviders
指定針對舊版 SharePoint 產品和技術所建置的追蹤提供者可以寫入 SharePoint 產品的追蹤會話。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AppAnalyticsAutomaticUploadEnabled
指定是否要將彙總應用程式使用資料自動上傳至 Microsoft。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AssignmentCollection
管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。
使用 Global 參數時,所有物件會包含在全域儲存區內。
如果不立即使用物件,或使用 Stop-SPAssignment
命令加以捨棄,則可能會有記憶體不足的狀況發生。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-CustomerExperienceImprovementProgramEnabled
指定是否參與客戶經驗改進計畫 (CEIP)。
CEIP 之目的是改進 Microsoft 產品和技術的品質、可靠性和執行效能。 在您的許可權下,伺服器的匿名資訊會傳送給Microsoft,以協助改善 SharePoint 產品。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DaysToKeepLogs
指定追蹤記錄檔要保留的天數。 此類型必須是 1 到 366 之間的有效數字。 預設值為 14 天。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DownloadErrorReportingUpdatesEnabled
指定是否下載錯誤報告遠端控制檔案。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ErrorReportingAutomaticUploadEnabled
指定錯誤報告是否自動上傳至 Microsoft。
錯誤報告包含下列資訊:發生問題時的伺服器狀態相關資訊;作業系統版本和使用中的電腦硬體;以及可用來識別授權的數位產品識別碼。 電腦的 IP 位址也會一併傳送,因為您是連線到線上服務來傳送錯誤報告;然而,IP 位址只會用來產生彙總的統計資料。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ErrorReportingEnabled
指定是否採集錯誤報告。
當您的系統遇到硬體或軟體問題時,會建立錯誤報告。 Microsoft 及其合作夥伴會主動使用這些報告以改進您軟體的可靠性。 錯誤報告包含下列資訊:發生問題時的伺服器狀態相關資訊;作業系統版本和使用中的電腦硬體;以及可用來識別您的授權之數位產品識別碼。 電腦的 IP 位址也會一併傳送,因為您是連線到線上服務來傳送錯誤報告;然而,IP 位址只會用來產生彙總的統計資料。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-EventLogFloodProtectionEnabled
指定是否啟用防止事件記錄檔濫記功能。
如果將多個類似事件寫入事件記錄檔,則會隱藏一些重複的訊息。 然後,在一段時間之後,會寫入摘要訊息,顯示已隱藏的事件數目。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-EventLogFloodProtectionNotifyInterval
指定以分鐘計的摘要事件寫入頻率,指出因防止濫記而隱藏的事件數。
此整數範圍介於 1 到 1440 之間。 預設值為 5。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-EventLogFloodProtectionQuietPeriod
指定不激發事件即結束防止濫記的時間,以分鐘計。
整數的範圍介於 1 到 1440 之間。 預設值為 2。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-EventLogFloodProtectionThreshold
指定設定時間範圍內允許的事件數,超過此數即視為事件記錄檔濫記的事件。
整數的範圍介於 1 到 100 之間。 預設值為 5。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-EventLogFloodProtectionTriggerPeriod
指定留意可能濫記事件的時間範圍,以分鐘計。
整數的範圍介於 1 到 1440 之間。 預設值為 2。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-InputObject
使用 Cmdlet Get-SPDiagnosticConfig
的結果進行修改,然後將物件管線至 Set-SPDiagnosticConfig
Cmdlet 以更新內容資料庫。
Type: | PSObject |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LogCutInterval
指定記錄檔變換之間的分鐘數。
此值必須是 0 到 1440 之間的有效整數。
預設值為 30。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LogDiskSpaceUsageGB
指定用於追蹤記錄檔的儲存量上限,以 GB 計。
預設值為 1000,且只有在 LogMaxDiskSpaceusageEnabled cmdlet 設為 True 時才生效。
此類型必須是 1 到 1000 之間的有效數字。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LogLocation
指定記錄檔所在位置的路徑。
此類型必須是有效的路徑,格式為 C:\Logs。
預設位置為 %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\Logs。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LogMaxDiskSpaceUsageEnabled
指定是否要限制用於追蹤記錄檔的空間上限。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $False。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ScriptErrorReportingDelay
指定指令碼錯誤報告的間隔時間 (以分鐘計)。
此類型必須是 0 到 1440 之間的有效整數。 此值以分鐘計。
預設值為 30。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ScriptErrorReportingEnabled
指定是否要啟用用戶端指令碼錯誤的錯誤報告。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ScriptErrorReportingRequireAuth
指定指令碼錯誤報告是否需要驗證。
此類型必須是下列其中一個值:
- $True
- $False
預設值為 $True。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |