Posts

Showing posts from April, 2017

SharePoint Search Service application content sources showing Paused

There may be many reasons for content sources to get into Paused  Below PowerShell script will help you c hecks status of Search Service application whether its running or Paused. If paused then returns the detailed information why its paused and asks input from user to resume  asnp "*sharepoint*" $searchserviceapps = Get-SPEnterpriseSearchServiceApplication foreach ($ssa in $searchserviceapps) {  Write-Host $ssa  -ForegroundColor Magenta $band = "0x" $band0 = "0x0" Function Details()     { $Detail = Read-Host "Do you want to see detailed reasons (Y/N) " If($Detail -eq "y")         { Write-Host " (band 0x01)          A change in the number of crawl components or crawl databases is in progress. (band 0x02)          A backup or restore procedure is in progress. (band 0x04)          A backup of the Volume Shadow Copy Service (VSS) is in progress. (band 0x08)          

PoweShell script to perform IISReset across all servers in SharePoint Farm

Get all Servers in the Farm with the role not like invalid, get IIS application pool status if any app pool found stopped then restarts the same and finally returns the status of Application pool. asnp "*sh*" $servers = Get-SPServer | ?{$_.Role -ne "Invalid"} foreach ($server in $servers)   {     $servername = $server.Address     Write-Host "Application Pool Status in : $server" -f Yellow       Invoke-Command -ComputerName $servername -ScriptBlock {    Import-Module WebAdministration   IISRESET /noforce   IISRESET /Status       cd IIS:\    $apppool =  gci .\AppPools    try    {      $apppool | ?{$_.state -eq "stopped" } | Start-WebAppPool     sleep 2;      }    catch    {        Write-Error $_;    }    finally    {       $apppool | select Name, State | Format-Table           Write-Host;    }    } #End of Scriptblock  }

SharePoint web application not created in IIS web server

As long as you have SharePoint web application service instance on the servers then any web application should be automatically get created in IIS, some times when New Web application is created and if it doesn't create  IIS Site in all Servers(WFE's) as it should then we can run below command to re-provision that web application to created IIS site using below Command which force web application to register in IIS asnp "*sharepoint*"   $webapp = get-spwebapplication <"URL of web application"> $ webapp  .provisionglobally()

SharePoint Farm Reboot

Below script will help you to reboot all servers in SharePoint Farm. asnp "*sharepoint*" $servers = Get-SPServer | ?{$_.Role -ne "Invalid"} foreach ($server in $servers)   {     $servername = $server.Address     Write-output "Executing on : $server" -ForegroundColor Yellow     if($env:COMPUTERNAME -ne $servername)     { Write-output $servername   SHUTDOWN /r /f /t 0 /m \\$servername       }   }   SHUTDOWN /r /f /t 0 /m \\$env:COMPUTERNAME