Restarting An App Pool From The Command Line
Working my way through a SharePoint development, I had cause to refer to the book "Inside Microsoft Windows SharePoint Services 3.0" written by Ted Pattison & Daniel Larson.
Whil looking up the info I needed I saw a section on page 33 entitles "Restarting an Application Pool". This section describes how using iisreset restarts all of the processes running under IIS and how using the command line:
cscript iisapp /a "DefaultAppPool" – where DefaultAppPool is an app pool on your server
will reset only that process thereby preserving all of the other processes and saving time and reources.
I gave this a go and found that it didn’t quite work, producing output like this:
The following W3WP.exe processes are serving AppPool: DefaultAppPool
W3WP.exe PID: xxxx
W3WP.exe PID: xxxx
The actual command required is cscript iisapp /a "DefaultAppPool" /r which resets only the process you’re interested in (in a fraction of the time of iisreset) and produces output like this:
Connecting to server …Done.
Application pool ‘DefaultAppPool‘ recycled successfully.
Application pool ‘DefaultAppPool‘ recycled successfully.
Later editions of the book (I have a 2007 edition) may have this fixed.
Leave a Reply