How to Restart IIS from a Sql Server Agent Job
Mar 1st, 2007 by Onyrix 743 Views |
Email This Post
|
Print This Post
Suppose to have an ASP3 or ASP.Net application running on the same machine where you Microsoft Sql Server runs.
For sure you have experienced that IIS grows up in memory (or better: the underlying worker processes) day by day decreasing constantly the overall system performances.
The most used solution to restore an initial idle state of the system is to schedule a nightly IIS RESTART.
Also, many System Administrators wants to keep a unique eye on a unique Job Scheduler and Log, and if you have Sql Server Agent you can think to use it to run any kind of processes (from stored procedure to windows executables).
So, to restart your IIS, schedule this piece of T-SQL code directly in Sql Server Agent:
Simply not?
exec master..xp_cmdshell ‘iisreset /RESTART’

del.icio.us
Digg
Furl
Reddit
Technorati