Wednesday, December 22, 2010

Recycle Application Pool using Command Line

IIS 6 uses different management scripts than IIS 7.

This is important to note as all your target environments may not have same version of IIS.

To recycle Application Pool in IIS 6, use the following script (in .bat file):

@set apppool=SharePoint - testportal.mycompany.com80
cscript.exe %windir%\system32\iisapp.vbs /a "%apppool%" /r

To recycle Application Pool in IIS 7, use the following:

@set apppool=SharePoint - testportal.mycompany.com80
%windir%\system32\inetsrv\appcmd recycle apppool /"%apppool%"

Make sure there is no space between “” and "%apppool%" otherwise you’ll receive an error.

No comments:

Post a Comment

Feel free to give constructive feedback or let me know if it was helpful.