Last active
December 8, 2016 14:59
-
-
Save cloudchristoph/596425e32d3adaf09a36606a67408053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asnp *share* | |
write-host "Getting timerjob definitions..." | |
$jobs = Get-SPTimerJob | ? {$_.Title -like "Health Analysis Job*"} | |
if (!$jobs -or $jobs.Count -eq 0) { | |
# Maybe in German? :) | |
$jobs = Get-SPTimerJob | ? {$_.Title -like "Integritätsanalyseauftrag*"} | |
} | |
if (!$jobs -or $jobs.Count -eq 0) { | |
throw "Found no timerjobs." | |
} | |
write-host "Found" $jobs.Count "timerjobs. Calling RunNow on all of them..." -f y | |
foreach ($job in $jobs) { | |
write-host $job.Title | |
$job.RunNow() | |
} | |
write-host "Getting Central Admin URL..." -f Y | |
$caUrl = Get-SPWebApplication -includecentraladministration | where {$_.IsAdministrationWebApplication} | Select-Object -ExpandProperty Url | |
write-host "Open IE with current timerjob status..." -f Y | |
$ie = New-Object -com internetexplorer.application; | |
$ie.visible = $true; | |
$ie.navigate($caUrl + "/_admin/ServiceRunningJobs.aspx"); | |
write-host "finished" -f Green |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment