SharePoint Server 中的設定檔結構描述參照Profile schema reference in SharePoint Server

摘要:了解用於 SharePoint Server 2016 和 SharePoint 2013 的已編寫監視設定指令碼中,設定檔的 XML 結構描述。Summary: Understand the XML schema for profiles for use in scripted monitoring configuration for SharePoint Server 2016 and SharePoint 2013.

當您在 SharePoint 伺服器陣列上執行 BackupMonitoringSettings.ps1 Microsoft PowerShell 指令碼,您會建立一個稱作設定檔的檔案。該設定檔遵循 XML 結構描述。您可以修改的結構描述的項目設定,以建立自訂的設定檔。您可以接著使用自訂的設定檔,以自動設定在 SharePoint 環境中的監視設定。如需已編寫監視設定指令碼的簡介,請參閱<SharePoint Server 中的已編寫監視設定指令碼概觀>。When you run the BackupMonitoringSettings.ps1 Microsoft PowerShell script on a SharePoint farm, you create a file that's called a Profile. The Profile follows an XML schema. You can modify settings of elements of the schema to create a custom Profile. You can then use the custom Profile to automate configuration of the monitoring settings in a SharePoint environment. For an introduction to scripted monitoring configuration, see Overview of scripted monitoring configuration in SharePoint Server.

系統管理員可以執行指令碼之前、期間和之後的變更至伺服器陣列,伺服陣列拓撲,主要的安全性變更,例如套用軟體更新,或執行效能測試。指令碼會變更監視設定,使所有必要的監視資料是在事件期間收集,而不會在正常操作期間濫記到記錄資料庫。Administrators can run the scripts before, during, and after changes to the farm, such as farm topology, major security changes, applying software updates, or running a performance test. The scripts alter the monitoring settings so that all of the necessary monitoring data are collected during the event without flooding the Logging database during normal operation.

注意

您必須先下載至備份、 還原或修改伺服器陣列監視設定的 PowerShell 指令碼。指令碼可供使用指令碼監控組態-BackupMonitoringSettings指令碼監控組態-AlterMonitoringSettingsTechNet 組件庫。BackupMonitoringSettings.ps1 PowerShell 指令碼會建立您可以建立其他設定檔的備份設定檔。You must download the PowerShell scripts to back up, restore, or modify the farm monitoring settings. The scripts are available on the TechNet Gallery at Scripted Monitoring Configuration - BackupMonitoringSettings and Scripted Monitoring Configuration - AlterMonitoringSettings. The BackupMonitoringSettings.ps1 PowerShell script creates the backup Profile from which you can create other Profiles.

您可以建立一或多個設定檔,以調整在 SharePoint 生命週期的不同階段的監視等級。您也可以使用自訂的設定檔,在數個伺服器陣列上立刻進行監視設定。You can create one or more Profiles to adjust the level of monitoring during different phases of the SharePoint lifecycle. You can also use a custom Profile to configure monitoring on several farms at once.

您通常會為下列用途建立設定檔:You would typically create Profiles for the following purposes:

  • 在您安裝 SharePoint Server 之後,若要在伺服器陣列上完成監視設定To complete the configuration of the monitoring settings on a farm after you install SharePoint Server

  • 在變更系統管理之前,例如在伺服器陣列上變更應用程式 [搜尋] 服務的設定,若要將伺服器陣列上的監視設定變更To change the monitoring settings on a farm just before an administrative change, such as changing the settings of a Search service application on the farm

    如此一來,您可以擷取更多關於變更的監視資料,並隱藏不想要的監控資料。完成變更後,您可以接著將監視設定還原為原始值。As a result, you can capture more monitoring data related to that change and suppress unwanted monitoring data. Then you can return the monitoring settings to the original values after the change has been completed.

  • 在變更系統管理後,若要將伺服器陣列上的監控設定還原To restore the monitoring settings on a farm after some administrative change

  • 若要將伺服器陣列上的前一組監視設定還原To restore a previous set of monitoring settings on a farm

    如果您正在手動調整設定,並決定要還原先前的設定,您可以這麼做。You might do this if you are making manual adjustments to the settings and decide that you want to restore the previous settings.

  • 若要還原預設設定To restore the default settings

  • 若要建立可以套用至多個伺服器陣列的設定檔To create a profile that you can apply to multiple farms

備份原始設定Backing up the original settings

您應該永遠在變更監視設定的預設值之前進行備份。如此一來,您可以還原這些您所需要的設定。該備份設定檔也可以做為您將建立的其他設定檔起點。如需關於如何備份這些設定的詳細資訊,請參閱<在 SharePoint Server 執行已編寫監視設定指令碼>。You should always back up the default monitoring settings before altering them. That way, you can restore those settings should you need to. The backup Profile also can serve as the beginning point for the other Profiles you will create. For more information about how to back up the settings, see Run scripted monitoring configuration in SharePoint Server.

了解設定檔結構描述Understanding the Profile schema

當您執行 BackupMonitoringSettings.ps1 PowerShell 指令碼,您會建立符合下列 XML 結構描述的設定檔。檔案項目會包含來自伺服器陣列的相關監視設定。When you run the BackupMonitoringSettings.ps1 PowerShell script, you create a Profile that conforms to the following XML schema. The elements of the file contain the associated monitoring settings from the farm.

<?xml version="1.0" standalone="yes"?>
<Configuration>
  <FarmDiagnosticConfig />
  <UsageServices>
    <UsageService />  
  </UsageServices>
  <UsageDefinitions>
    <UsageDefinition />
  </UsageDefinitions>
  <LogLevels>
    <LogLevel />
  </LogLevels>
  <TimerJobs>
    <TimerJob />
  </TimerJobs>
  <HealthAnalyzerRules>
    <HealthAnalyzerRule />
  </HealthAnalyzerRules>
</Configuration>

重要

[!重要事項] 在下列表格中,您無法在標示為 [唯讀] 的欄位中變更值。如果您在設定檔的 [唯讀] 欄位變更值,可能會發生無法預期的結果。In the following tables, you cannot change values in fields that are marked as Read-Only. If you change values in Read-Only fields in your Profiles, unpredictable results may occur.

FarmDiagnosticConfig 項目設定Settings for the FarmDiagnosticConfig element

名稱Name 值類型Value Type 附註Notes
AllowLegacyTraceProvidersAllowLegacyTraceProviders
布林值Boolean
指定為舊版 SharePoint 產品及技術所建的追蹤提供者,可寫入 SharePoint Server 產品的追蹤工作階段。Specifies that trace providers built for previous versions of SharePoint Products and Technologies can write to the trace session for SharePoint Server.
AppAnalyticsAutomaticUploadEnabledAppAnalyticsAutomaticUploadEnabled
布林值Boolean
指定是否要將彙總應用程式使用資料自動上傳至 Microsoft。Specifies whether aggregated app usage data is automatically uploaded to Microsoft.
CustomerExperienceImprovementProgramEnabledCustomerExperienceImprovementProgramEnabled
布林值Boolean
決定管理群組是否啟用 [參與客戶經驗改進計畫] 功能。Determines whether a Management Group has enabled the Customer Experience Improvement Program feature.
ErrorReportingEnabledErrorReportingEnabled
布林值Boolean
取得或設定值,用以表示是否啟用損毀資料收集和錯誤報告。Gets or sets a value to indicate whether crash data collection and error reporting is enabled.
ErrorReportingAutomaticUploadEnabledErrorReportingAutomaticUploadEnabled
布林值Boolean
指定是否啟用參與客戶經驗改進計畫 (CEIP)。CEIP 之目的是改進 Microsoft 產品和技術的品質、可靠性和執行效能。經由您的許可,關於您伺服器的匿名資訊將會傳送至 Microsoft,以協助我們改進 SharePoint Server。Specifies whether participation in the Customer Experience Improvement Program (CEIP) is enabled. The CEIP is designed to improve the quality, reliability, and performance of Microsoft products and technologies. With your permission, anonymous information about your server is sent to Microsoft to help improve SharePoint Server.
DownloadErrorReportingUpdatesEnabledDownloadErrorReportingUpdatesEnabled
布林值Boolean
指定錯誤報告是否自動上傳至 Microsoft。錯誤報告包括:伺服器發生問題時,作業系統版本和電腦硬體使用及數位產品 ID,可以用來識別您的授權條件相關資訊。 Specifies whether error reports are uploaded to Microsoft automatically. Error reports include the following: Information about the condition of the server when a problem occurs, The operating system version and computer hardware in use, and The digital product ID, which can be used to identify your license.
Note:Note:
因為您連線到線上服務傳送錯誤報告,這也會傳送您的電腦的 IP 位址;不過,IP 位址只用於產生彙總的統計資料。The IP address of your computer is also sent because you are connecting to an online service to send error reports; however, the IP address is used only to generate aggregate statistics.
DaysToKeepLogsDaysToKeepLogs
整數Integer
指定追蹤記錄檔要保留的天數。此類型必須是 1 到 366 之間的有效數字。預設值為 14 天。Specifies the number of days to keep trace log files. The type must be a valid number between 1 and 366. The default value is 14 days.
LogMaxDiskSpaceUsageEnabledLogMaxDiskSpaceUsageEnabled
布林值Boolean
指定是否要限制用於追蹤記錄檔的空間上限。Specifies whether to restrict the maximum space to use for trace log files.
LogDiskSpaceUsageGBLogDiskSpaceUsageGB
整數Integer
指定用於追蹤記錄檔的儲存量上限,以 GB 計。預設值為 1000,且只有在 LogMaxDiskSpaceusageEnabled 參數設為 True 時才生效。此類型必須是 1 到 1000 之間的有效數字。Specifies the maximum amount of storage to use for trace log files, in gigabytes (GB). The default value is 1000 and only takes effect when the LogMaxDiskSpaceusageEnabled parameter is set to True. The type must be a valid number between 1 and 1000.
LogLocationLogLocation
字串:路徑String:Path
這是您想要儲存的記錄檔的位置的完整路徑。可以是遠端位置。範例:"%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\16\LOGS" 和 "%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\15\LOGS"This is the full path to the location where you want log files to be stored. It can be a remote location. Example: "%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\16\LOGS" and "%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\15\LOGS"
LogCutIntervalLogCutInterval
整數Integer
指定變換成下一份記錄檔案的時間。此類型必須是 0 到 1440 之間的有效數字。Specifies a time period to roll over to the next log file. The type must be a valid number between 0 and 1440.
EventLogFloodProtectionEnabledEventLogFloodProtectionEnabled
布林值Boolean
指定是否啟用防止濫記事件功能。若有多件相似事件寫入事件記錄檔,會隱藏某些重複的訊息,然後在一段時間之後寫入摘要訊息,指出隱藏的事件數。Specifies whether the Event log flood protection feature is enabled. If multiple similar events are written to the event log, some duplicate messages are suppressed. After a period of time, a summary message shows how many events were suppressed.
EventLogFloodProtectionThresholdEventLogFloodProtectionThreshold
整數Integer
指定設定時間範圍內允許的事件數,超過此數即視為事件記錄檔濫記的事件。整數的範圍介於 1 到 100 之間。預設值為 5。Specifies the number of events allowed in a given timeframe before an event is considered to be flooding the event log. The integer range is between 1 and 100. The default value is 5.
EventLogFloodProtectionTriggerPeriodEventLogFloodProtectionTriggerPeriod
整數Integer
指定留意可能濫記事件的時間範圍,以分鐘計。整數的範圍介於 1 到 1440 之間。預設值為 2。Specifies in minutes the timeframe to watch for events that may be flooding. The integer range is between 1 and 1440. The default value is 2.
EventLogFloodProtectionQuietPeriodEventLogFloodProtectionQuietPeriod
整數Integer
指定不激發事件即結束防止濫記的時間,以分鐘計。整數的範圍介於 1 到 1440 之間。預設值為 2。Specifies in minutes how much time must pass without an event firing to exit flood protection. The integer range is between 1 and 1440. The default value is 2.
EventLogFloodProtectionNotifyIntervalEventLogFloodProtectionNotifyInterval
整數Integer
指定以分鐘計的摘要事件寫入頻率,指出因防止濫記而隱藏的事件數。整數的範圍介於 1 到 1440 之間。預設值為 5。Specifies in minutes how often to write a summary event that indicates how many events were suppressed due to flood protection. The integer range is between 1 and 1440. The default value is 5.
ScriptErrorReportingEnabledScriptErrorReportingEnabled
布林值Boolean
啟用或停用記錄檔中的指令碼錯誤的報告。Enables or disabled the reporting of script errors in the Log file.
ScriptErrorReportingRequireAuthScriptErrorReportingRequireAuth
布林值Boolean
指定指令碼錯誤報告是否需要驗證。Specifies whether script error reporting requires authentication.
ScriptErrorReportingDelayScriptErrorReportingDelay
整數Integer
以分鐘計,指定指令碼錯誤報告的間隔時間。此值必須是 0 到 1440 之間的有效整數。此值以分鐘為單位。預設值為 30。Specifies the time in minutes between script error reports. The value must be a valid integer between 0 and 1440. The value is specified in minutes. The default value is 30.

下表可用於 UsageServices 設定。Use the following table for the UsageServices settings.

UsageServices 設定中的項目The elements of the UsageServices settings

名稱Name 值類型Value Type 附註Notes
IDID
GUID: 唯讀GUID: Read-Only
格式為 12345678-90ab-cdef-1234-567890bcdefgh 的 GUIDA GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.
UsageLogLocationUsageLogLocation
路徑Path
指定要建立流量檔案之伺服器陣列中每部電腦的路徑。在伺服器陣列中的所有電腦上必須要有相同的路徑。Specifies the path on every computer in the farm where usage log files are created. The same path must exist on all computers in the farm.
LoggingEnabledLoggingEnabled
布林值Boolean
指定記錄至流量檔案的流量資料。Specifies that usage data is logged to usage files.
UsageLogMaxFileSizeKBUsageLogMaxFileSizeKB
整數Integer
指定套用至所有流量提供者之單一流量檔案的大小上限。最小值為 512 KB,而最大值為 65536 KB。Specifies the maximum size of a single usage file that is applied to all the usage providers. The minimum value is 512 kilobytes (KB) and the maximum value is 65536 KB.
UsageLogCutTimeUsageLogCutTime
整數Integer
以分鐘為單位,指定每個流量記錄檔收集流量資料的時間。預設時間為 5 分鐘。此值必須為整數,且介於 1 到 1440 之間。Specifies the time in minutes of usage data that is collected per usage log file. The default time is 5 minutes. The value must be an integer in the range of 1 to 1440.

下表可用於 UsageDefinition 設定。Use the following table for the UsageDefinition settings.

UsageDefinition 設定中的項目The elements of the UsageDefinition settings

名稱Name 值類型Value Type 附註Notes
IDID
GUID: 唯讀GUID: Read-Only
格式為 12345678-90ab-cdef-1234-567890bcdefgh 的 GUIDA GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.
名稱Name
字串: 唯讀String: Read-Only
UsageDefinition 的字串名稱。The string name of the UsageDefinition.
DaysRetainedDaysRetained
整數Integer
指定使用狀況提供者在使用服務資料庫中可保留使用資料的天數。預設值為 14。此類型必須是介於 0 與 31 之間的整數。 Specifies the number of days to retain usage data for the usage provider in the usage service database. The default value is 14. The type must be an integer between 0 and 31.
DaysToKeepUsageFilesDaysToKeepUsageFiles
整數Integer
指定要保留檔案使用情況的天數。此值必須小於或等於 DaysRetained 參數值。 Specifies the number of days to retain usage files. The value must be less than or equal to value of the DaysRetained parameter.
啟用Enabled
布林值Boolean
啟用或停用指定的使用情況提供者。Enables or disables the specified usage provider.

下表可用於 LogLevel 設定。Use the following table for the LogLevel settings.

元素的 LogLevel 設定The elements of the LogLevel settings

名稱Name 值類型Value Type 附註Notes
範圍Area
字串: 唯讀String: Read-Only
元件或 LogLevel 會套用到的服務。The component or service that the LogLevel applies to.
身分識別Identity
字串: 唯讀String: Read-Only
指定類別或一組類別的名稱用以設定節流,例如,「整合記錄服務」。Specifies the names of the category or set of categories to set the throttle for; for example, "Unified Logging Service".
Note:Note:
如果未指定 Identity 參數,調整事件流速的設定會套用至伺服器陣列中的所有類別。If the Identity parameter is not specified, the event-throttling setting is applied to all categories in the farm.
EventSeverityEventSeverity
字串:[無String:[None ErrorCriticalErrorCritical
TraceSeverityTraceSeverity
字串:[無String:[None 未預期Unexpected

使用下表的計時器工作設定。Use the following table for the TimerJob settings.

TimerJob 設定中的項目The elements of the TimerJob settings

名稱Name 值類型Value Type 附註Notes
身分識別Identity
GUID: 唯讀GUID: Read-Only
指定要更新的計時器工作。此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID。Specifies the timer job to update. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.
排程Schedule
字串String
指定執行計時器工作的排程。此類型必須是有效的 SharePoint 計時器服務 (SPTimer) 排程,格式為下列任一排程:在 15:00:00,星期五之間,每週的每天每隔 5 分鐘介於 0 到 59 之間,每小時介於 0 和 59,22:00:00 和週日 06:00:00,每月 15 15:00:00 和每年在 1 年 1 月 15:00:00Specifies the schedule for running the timer job. The type must be a valid SharePoint Timer service (SPTimer) schedule in the form of any one of the following schedules: Every 5 minutes between 0 and 59, Hourly between 0 and 59, Daily at 15:00:00, Weekly between Fri 22:00:00 and Sun 06:00:00, Monthly at 15 15:00:00, and Yearly at Jan 1 15:00:00
啟用Enabled
布林值Boolean
啟用或停用計時器工作Enables or disables the timer job.

下表可用於 HealthAnalyzerRule 設定。Use the following table for the HealthAnalyzerRule settings.

HealthAnalyzerRule 設定中的項目The elements of the HealthAnalyzerRule settings

名稱Name 值類型Value Type 附註Notes
身分識別Identity
GUID: 唯讀GUID: Read-Only
指定要設定的狀況分析規則名稱或 GUID。Specifies the name or GUID of the health analyzer rule to set.
啟用Enabled
布林值Boolean
啟用或停用狀況分析規則Enables or disables the health analyzer rule.

建立設定檔Create Profiles

您可以建立無數個設定檔。每個設定檔可能會用於不同的用途,例如在對環境進行特定變更之前增加監視的層級,或在變更後到較低的層級。 You can create an unlimited number of Profiles as. Each Profile might be used for a different purpose, such as to increase the levels of monitoring before a specific change to the environment, or to lower the levels after a change.

您只需要建立想要的特定變更的設定檔項目。其他的設定將維持不變。例如,如果您想要變更一些 LogLevel 設定,然後您只需要在設定檔中指定這些設定。未指定設定檔中的設定將不會變更。You only need to create profile entries for the specific changes that you want to make. The other settings will remain unchanged. For example, if you want to change a few LogLevel settings, then you only need to specify those settings in the Profile. Settings that are not specified in the Profile will not be changed.

您可能想要使用您的設定檔的命名慣例,以便您可以將它們組織,並更輕易地使用。You might want to use a naming convention for your Profiles so that you can organize them and more easily use them.

重要

[!重要事項] 永遠在對監視設定進行任何變更前備份。總是從備份設定檔的複本運作,而且絕不會從原始的備份檔案本身運作。Always back up the monitoring settings before making any changes to them. Always work from a copy of the backup Profile and never from the original backup file itself.

另請參閱See also

概念Concepts

SharePoint Server 中的已編寫監視設定指令碼概觀Overview of scripted monitoring configuration in SharePoint Server

在 SharePoint Server 執行已編寫監視設定指令碼Run scripted monitoring configuration in SharePoint Server