Export (0) Print
Expand All

Run scripted monitoring configuration in SharePoint 2013

SharePoint 2013

Published: May 7, 2013

Summary: Learn how to use Windows PowerShell scripts and Profile files to automatically back up, restore, or change monitoring settings in a SharePoint 2013 environment.

Applies to:  SharePoint Foundation 2013 | SharePoint Server 2013 

Scripted monitoring configuration uses Windows PowerShell scripts and XML files, which are known as Profiles, to back up, restore, or configure monitoring settings in the SharePoint 2013 environment. For more conceptual information about scripted monitoring configuration, see Overview of scripted monitoring configuration in SharePoint 2013

note Note:

You must download the Windows PowerShell scripts to back up, restore, or change the farm monitoring settings. When you run the BackupMonitoringSettings.ps1 Windows PowerShell script, you create the backup Profile from which you can create other Profiles.

Use the BackupMonitoringSettings.ps1 script

You can use scripted monitoring configuration to back up the monitoring settings for the farm. You should do this immediately after you complete the deployment of the farm to make sure that that you can restore the farm to its original settings. You can also back up the settings before or after any changes to the farm.

Important Important:

This script is available on the TechNet Gallery at Scripted Monitoring Configuration - BackupMonitoringSettings.

To back up the farm monitoring settings

  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    note Note:

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.

  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, type the following command:

    .\BackupMonitoringSettings.ps1 “<ProfileFolder>”
    

    Where:

    • <ProfileFolder> is full path of the folder that you want to store the backup settings Profile in. The XML file name is in the form “BackupSetting_[DATE] @ [Time].xml”. The script will create a new file every time that it is run.

Use the AlterMonitoringSettings.ps1 script

You can use scripted monitoring configuration to change or restore the monitoring settings for the farm. To change the settings, create a copy of the backup Profile and change the settings in the copy to create a new Profile. To apply the settings in the new Profile, run the AlterMonitoringSettings.ps1 script and specify the path of the specific Profile you want to use. For more information about how to create Profiles, see Profile schema reference in SharePoint 2013.

Important Important:

This script is available on the TechNet Gallery at Scripted Monitoring Configuration - AlterMonitoringSettings.

Restore settings

You can use scripted monitoring configuration to restore the monitoring settings for the farm at any time. You can restore the settings to any values for which you have a corresponding Profile.

To restore the farm monitoring settings

  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    note Note:

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.

  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, navigate to the folder that you downloaded the BackupMonitoringSettings.ps1 and AlterMonitoringSettings.ps1 scripts to.

  4. At the Windows PowerShell command prompt, type the following command:

    .\AlterMonitoringSettings.ps1 “<ProfilePath>”
    

    Where:

    • <ProfilePath> is full path of the backup Profile that you want to use to restore the monitoring settings for the farm.

Apply settings changes

You can use scripted monitoring configuration to change the monitoring settings for the farm. To change the settings, run the RestoreMonitoringSettings.ps1 script and specify the path of the specific Profile that you want to use. For more information about how to create Profiles, see Profile schema reference in SharePoint 2013.

To apply monitoring settings changes to the farm

  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    • Add memberships that are required beyond the minimums above.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    note Note:

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.

  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, navigate to the folder that you downloaded the BackupMonitoringSettings.ps1 and AlterMonitoringSettings.ps1 scripts to.

  4. At the Windows PowerShell command prompt, type the following command:

    .\AlterMonitoringSettings.ps1 “<ProfilePath>”
    

    Where:

    • <ProfilePath> is full path of the specific Profile that you want to use to configure the monitoring settings for the farm.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft