SharePoint Use Cases

18 Oct, 2010

Run all SharePoint 2010 health rules now!

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

Joel recently posted: Warning to SharePoint Administrators: Don’t Ignore the Red Health Bar and you should follow his advice and maintain your farm. While preparing a roll-out for a client I created yet another SharePoint 2010 lab/test farm. Once finished I wanted to check if everything is okey with the farm, but could not wait for hour/day/week month till health jobs executed via SharePoint timer. Here is a simple PowerShell script to execute all farm health check immediately:

    # check to ensure Microsoft.SharePoint.PowerShell is loaded
    $snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
    if ($snapin -eq $null) {
      Write-Host "Loading SharePoint Powershell Snapin"
      Add-PSSnapin "Microsoft.SharePoint.Powershell"
    }
    Get-SPTimerJob | Where {$_.Name -like "*Health*" -and $_.Name -like "*-all-*"} | Start-SPTimerJob
    

    Couple of notes:

    • The script will start all SPTimerJobs that contain words Health and -all- in job name
    • A “health job” with the keyword “-all-” in its name will run on all servers in the farm that run the SharePoint Timer Service and the Usage and Health Data Collection Service application
    • A “health job” with the keyword “-any-” in its name will run on the first server found in the farm that runs the SharePoint Timer Service and the Usage and Health Data Collection Service application.
    • Check full list of SPTimerJob definitions.


    Documentation Toolkit for SharePoint

    Comments

    1 | Tweets that mention Run all SharePoint 2010 health rules now! | SharePoint Use Cases -- Topsy.com

    October 18th, 2010 at 5:01 pm

    Avatar

    [...] This post was mentioned on Twitter by Toni Frankola, SharePoint River. SharePoint River said: #SharePoint #SP2010 Run all SharePoint 2010 health rules now! http://ow.ly/19vXDR [...]

    Comment Form


    About

    Real-life use case and opinions about collaboration, CRM and web technologies and stuff by Toni Frankola. More...

    Toni Frankola - SharePoint MVP Profile

    All postings on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.

    Page optimized by WP Minify WordPress Plugin