Set-SPDiagnosticConfig

对服务器场设置诊断配置设置。

语法

Default (默认值)

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>]

说明

使用 Set-SPDiagnosticConfig cmdlet 在整个场上设置诊断配置设置。

有关适用于 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 Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定为早期版本的 SharePoint 产品和技术生成的跟踪提供程序可以写入 SharePoint 产品的跟踪会话。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AppAnalyticsAutomaticUploadEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否将聚合的应用程序使用率数据自动上载到 Microsoft。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AssignmentCollection

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

使用全局参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

参数属性

类型:SPAssignmentCollection
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-CustomerExperienceImprovementProgramEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否启用参与客户体验改善计划 (CEIP)。

CEIP 旨在改善 Microsoft 产品和技术的质量、可靠性和性能。 经您的许可,有关您的服务器的匿名信息将发送到Microsoft,以帮助改进 SharePoint 产品。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DaysToKeepLogs

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定保留跟踪日志文件的天数。 键入的值必须是介于 1 和 366 之间的有效数字。 默认值为 14 天。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DownloadErrorReportingUpdatesEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否下载错误报告远程控制文件。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ErrorReportingAutomaticUploadEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否将错误报告自动上载至 Microsoft。

错误报告包括下列内容:有关出现问题时服务器状况的信息;所使用的操作系统版本和计算机硬件;可用于标识您的许可证的数字产品 ID。 由于您连接到了联机服务以发送错误报告,因此也将发送您计算机的 IP 地址;不过,该 IP 地址仅用于生成汇总统计信息。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ErrorReportingEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否启用错误报告收集。

当系统遇到硬件或软件问题时,就会创建错误报告。 Microsoft 及其合作伙伴将积极使用这些报告来改善软件的可靠性。 错误报告包括下列内容:有关出现问题时服务器状况的信息;所使用的操作系统版本和计算机硬件;可用于标识您的许可证的数字产品 ID。 由于您连接到了联机服务以发送错误报告,因此也将发送您计算机的 IP 地址;不过,该 IP 地址仅用于生成汇总统计信息。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-EventLogFloodProtectionEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否启用事件日志淹没保护功能。

如果将多个类似事件写入事件日志,则会禁止显示一些重复的消息。 然后,在一段时间后,将写入一条摘要消息,显示已取消的事件数。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-EventLogFloodProtectionNotifyInterval

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

以分钟为单位指定写入摘要事件的频率,该事件指示因淹没保护而被取消显示的事件数。

该整数范围介于 1 到 1440 之间。 默认值为 5。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-EventLogFloodProtectionQuietPeriod

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定必须经过多少分钟之后才触发某一事件来退出淹没保护。

该整数范围介于 1 到 1440 之间。 默认值为 2。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-EventLogFloodProtectionThreshold

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定在给定时间范围内发生多少事件之后会将事件视为淹没事件日志。

该整数范围介于 1 到 100 之间。 默认值为 5。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-EventLogFloodProtectionTriggerPeriod

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

以分钟为单位指定查看可能淹没的事件的时间范围。

该整数范围介于 1 到 1440 之间。 默认值为 2。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-InputObject

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

使用 cmdlet 的结果 Get-SPDiagnosticConfig ,进行修改,然后将对象管道化为 Set-SPDiagnosticConfig cmdlet 以更新内容数据库。

参数属性

类型:PSObject
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-LogCutInterval

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定日志文件滚动更新之间的分钟数。

值必须是介于 0 和 1440 之间的有效整数。

默认值为 30。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-LogDiskSpaceUsageGB

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定用于跟踪日志文件的最大存储量 (GB)。

默认值为 1000,并且仅在 LogMaxDiskSpaceusageEnabled cmdlet 设置为 True 时生效。

键入的值必须是介于 1 和 1000 之间的有效数字。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-LogLocation

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定日志文件将驻留的位置的路径。

键入的值必须是格式为 C:\Logs 的有效路径。

默认位置为 %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\Logs。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-LogMaxDiskSpaceUsageEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否限制用于跟踪日志文件的最大空间。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $False。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ScriptErrorReportingDelay

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定脚本错误报告的间隔时间(分钟)。

键入的值必须是介于 0 和 1440 之间的有效整数。 该值以分钟为单位进行指定。

默认值为 30。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ScriptErrorReportingEnabled

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否对客户端脚本错误启用错误报告。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ScriptErrorReportingRequireAuth

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定脚本错误报告是否需要身份验证。

键入的值必须是下列值之一:

  • $True
  • $False

默认值为 $True。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters