clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell function Get-SPTimerJobStatus { Get-SPTimerJob | sort Name | ForEach-Object { $lastRun = $_.HistoryEntries | Select-Object -first 1 if ($_.WebApplication -eq $null) { $level = "Farm" } else { $level = $_.WebApplication.Url } $values = @{ "Name" = $_.Name "Level" = $level "StartTime" = $lastRun.StartTime "EndTime" = $lastRun.EndTime "Status" = $lastRun.Status } New-Object PSObject -Property $values | Select @("Name","Level","StartTime","EndTime","Status") } } Get-SPTimerJobStatus | Out-GridView
Showing posts with label Farm. Show all posts
Showing posts with label Farm. Show all posts
Thursday, January 11, 2018
Get All Timer Jobs Status from a Farm in GridView using PowerShell
Perform IISReset in all the servers of a SharePoint Farm using PowerShell
clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell } $host.Runspace.ThreadOptions = "ReuseThread" #Definition of the funcion that performs the IIS RESET in all the servers function PerformIISReset { try { #Getting the servers where the IISReset is going to be done $spServers= Get-SPServer | ? {$_.Role -eq "Application"} foreach ($spServer in $spServers) { Write-Host "Perform IIS Reset in server $spServer" -f blue iisreset $spServer /noforce "\\"$_.Address iisreset $spServer /status "\\"$_.Address } Write-Host "IIS Reset completed successfully!!" -f blue } catch [System.Exception] { write-host -f red $_.Exception.ToString() } } Start-SPAssignment –Global PerformIISReset Stop-SPAssignment –Global
Subscribe to:
Posts (Atom)
Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular
Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...
-
While Working on a VisualWebPart with Telerik Controls I got a Security Exception. I searched many blogs and articles, and found some i...
-
While working for an utility to redirect the tasks with some custom functionality I had to search for an option to bring the WorklistItems (...
-
We had an issue while updating the datafield values without executing the action in the application form. If we use ProcessInstance Updat...