Even though I don’t have to do this often, I still got sick of having to RDP or connect services.msc to each server in the farm and restart the timer service. So I found a script from http://chrisfederico.wordpress.com/2008/01/23/using-powershell-to-restart-services/ and tied in some get-spserver fun to programatically get and restart the timer service on each farm server.

[void] ([Reflection.Assembly]::LoadWithPartialName("System.ServiceProcess"))

$servers = Get-SPServer | Where {$_.Role -ne "Invalid" }
#or
#[array]$servers = "Server1","Server2","Server3","Server4"
foreach ($server in $servers) {
    $service = [System.ServiceProcess.ServiceController]::GetServices($server.name) | where-object {$_.Name -eq "SPTimerV4"}

    Write-host "Stopping:" $server.name
    #stop the service
    $service.Stop()
    $service.WaitForStatus("Stopped")

    Write-host "Starting:" $server.name
    #start the service
    $service.Start()
    
}

I also left in an array that can also be used if you don’t want to use get-spserver. Just uncomment the array line and comment out the get-spservers line.