Overview of scripted monitoring configuration in SharePoint 2013
Applies to: SharePoint Foundation 2013, SharePoint Server 2013
Topic Last Modified: 2013-12-18
Summary:Learn how to use Windows PowerShell and XML to automate the configuration of monitoring settings.
You can change the monitoring settings for the SharePoint 2013 environment several ways. One way is to use the SharePoint Central Administration website. You might use this to make a single change to a small, local farm. Another way is to use Windows PowerShell cmdlets directly. You might use this to make a single change to a local or remote farm. Still another way is to create your own Windows PowerShell scripts. You might use this to make several complex changes to a local or remote farm that might be done repeatedly.
Scripted monitoring configuration involves a set of Windows PowerShell script files and XML data files, called Profiles, to enable administrators to automate configuration of the monitoring settings in the SharePoint 2013 environment, including backing up and restoring these settings. Administrators can run the scripts before, during, and after changes to the farm. Changes might include updates of the farm topology, major security changes, software updates, or performance tests. The scripts change the monitoring settings so that all of the necessary monitoring data are collected during the event without flooding the Logging database during normal operation.
Usage Service settings
Log level settings
Timer job settings
SharePoint Health Analyzer rule settings
You can run scripted monitoring configuration to backup and restore monitoring settings for the farm without having to run backup and restore. You can use it to change the monitoring settings so that all of the necessary monitoring data is collected during the event without flooding the Logging database during normal operation. You can also run the scripts to tune the level of monitoring during different phases of the SharePoint lifecycle. For more information, see Run scripted monitoring configuration in SharePoint 2013.
You can also copy and modify the backup Profile to create Profiles for specific purposes. For more information, see Profile schema reference in SharePoint 2013.
Scripted monitoring configuration consists of both Windows PowerShell scripts and Profiles that contain the settings data for changes in the farm. The scripts are available on the TechNet Library. Following are the scripts and Profiles that are involved:
Run this Windows PowerShell script on a farm to back up various logging settings to an XML file.
Important: This script is available on the TechNet Gallery at Scripted Monitoring Configuration - BackupMonitoringSettings.
Run this Windows PowerShell script on a server to restore or change various logging settings by using an XML Profile as a data source.
Important: This script is available on the TechNet Gallery at Scripted Monitoring Configuration - AlterMonitoringSettings.
The BackupMonitoringSettings.ps1 script creates this XML file which contains all of the monitoring settings mentioned above. You can use the AlterMonitoringSettings.ps1 script backup file to restore the settings to the farm. You can also use this file as a template to create another Profile or to make changes to another farm.
Create one or more of these XML files to modify the settings to the farm by using the AlterMonitoringSettings.ps1 script.
Run the BackupMonitoringSettings.ps1 script
Run this script on a farm to back up various monitoring settings to an XML Profile that the script creates. The XML file name is in the form “BackupSetting_[DATE] @ [Time].xml”. The script creates a new file every time you run it.
Create a Profile by copying and altering settings in the backup Profile
You can make a copy of the BackupSettings.xml file and change the settings. You can then use the updated file as the source for changes to your farm.
Important: Always preserve the original BackupSettings.xml file so that you can use it to restore your farm to the original configuration. To create custom Profiles, modify a copy of the BackupSettings.xml file.
Applying settings changes by running the AlterMonitorngSettings.ps1 script
After you create your own Profile, you can run the AlterMonitoringSettings.ps1 script to apply those changes to the farm.
To restore the setting to a previous state, run the AlterMonitoringSettings.ps1 script and provide the path of a BackupSettings.xml file.
Apply a Profile to another farm
You can also use a Profile to apply the settings from one farm to another farm. Or you can use an updated settings file to apply settings to many farms.