Set-SPDiagnosticConfig

Sets diagnostic configuration settings on the farm.

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

Use the Set-SPDiagnosticConfig cmdlet to set diagnostic configuration settings on the entire farm.

For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at SharePoint Server Cmdlets.

Examples

------------------EXAMPLE 1-----------------------

Set-SPDiagnosticConfig -ErrorReportingEnabled -DownloadErrorReportingUpdatesEnabled:$false -DaysToKeepLog 60

This example enables ErrorReporting, disables DownloadErrorReportingUpdatesEnable and sets DaysToKeepLog to 60.

------------------EXAMPLE 2-----------------------

$config = Get-SPDiagnosticConfig
$config.CustomerExperienceImprovementProgramEnabled = $false
$config.LogCutInterval = 60
$config | Set-SPDiagnosticConfig

This example disables CEIP and sets LogCutInterval to 60 minutes.

Parameters

-AllowLegacyTraceProviders

Specifies that trace providers built for previous versions of SharePoint Products and Technologies can write to the trace session for SharePoint Products.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-AppAnalyticsAutomaticUploadEnabled

Specifies whether aggregated app usage data is automatically uploaded to Microsoft.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-CustomerExperienceImprovementProgramEnabled

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 Products.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DaysToKeepLogs

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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DownloadErrorReportingUpdatesEnabled

Specifies whether the error reporting remote control file is downloaded.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ErrorReportingAutomaticUploadEnabled

Specifies whether error reports are uploaded to Microsoft automatically.

Error reports include the following: information regarding 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. 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.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ErrorReportingEnabled

Specifies whether collection of error reports is enabled.

Error reports are created when your system encounters hardware or software problems. Microsoft and its partners actively use these reports to improve the reliability of the software. Error reports include the following: information regarding the condition of the server when the problem occurs; the operating system version and computer hardware in use; and the digital product ID, which can be used to identify your license. 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.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EventLogFloodProtectionEnabled

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. Then, after a period of time, a summary message is written that shows how many events were suppressed.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EventLogFloodProtectionNotifyInterval

Specifies in minutes how often to write a summary event indicating how many events were suppressed due to flood protection.

The integer range is between 1 and 1440. The default value is 5.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EventLogFloodProtectionQuietPeriod

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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EventLogFloodProtectionThreshold

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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EventLogFloodProtectionTriggerPeriod

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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-InputObject

Use the result from the Get-SPDiagnosticConfig cmdlet, make modifications and then pipeline the object into Set-SPDiagnosticConfig cmdlet to update the content database.

Type:PSObject
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LogCutInterval

Specifies the number of minutes between log file rollovers.

The value must be a valid integer between 0 and 1440.

The default value is 30.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LogDiskSpaceUsageGB

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 cmdlet is set to True.

The type must be a valid number between 1 and 1000.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LogLocation

Specifies the path of where to log files will reside.

The type must be a valid path, in the form C:\Logs.

The default location is %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 Subscription Edition

-LogMaxDiskSpaceUsageEnabled

Specifies whether to restrict the maximum space to use for trace log files.

The type must be either of the following values:

  • $True
  • $False

The default value is $False.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ScriptErrorReportingDelay

Specifies the time (in minutes) between script error reports.

The type must be a valid integer between 0 and 1440. The value is specified in minutes.

The default value is 30.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ScriptErrorReportingEnabled

Specifies whether error reporting is enabled for client script errors.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ScriptErrorReportingRequireAuth

Specifies whether script error reporting requires authentication.

The type must be either of the following values:

  • $True
  • $False

The default value is $True.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition