IIS reset in All WFE Server in SharePoint 2013 using Powershell

  1. Start your windows PowerShell on your computer.
  2. Right click and select Run as administrator option.
  3. Paste the below script on the PowerShell window and click the enter button.
  4. Check your SharePoint site Feature will activated successfully.
    1. function IISReset  
    2. {  
    3.     try  
    4.     {  
    5.         $spServers = Get - SPServer | ?   
    6.         {  
    7.             $_.Role - eq "Application"  
    8.         }  
    9.         foreach($spServer in $spServers)  
    10.         {  
    11.             Write - Host " IIS Reset in server is Processing $spServer" - f blue  
    12.             iisreset $spServer / noforce "\\"  
    13.             $_.Address  
    14.             iisreset $spServer / status "\\"  
    15.             $_.Address  
    16.         }  
    17.         Write - Host "IIS Reset has been completed successfully!!" - f blue  
    18.     } catch [System.Exception]  
    19.     {  
    20.         write - host - f red $_.Exception.ToString()  
    21.     }  
    22. }  
    23. Start - SPAssignment– Global# Calling the  
    24. function  
    25. IISReset  
    26. Stop - SPAssignment– Global  
    27. Remove - PSSnapin Microsoft.SharePoint.PowerShell  
Check the the sharepoint server and IIS application Pool has been started or stopped.
Thanks for reading my blogs.