Neufusion
2006-09-06 20:20:48 UTC
Goal:
Allow domain users the ability to reset / restart IIS remotely without
Administrator rights.
Scenario:
A certain server is running IIS 5.0 which needs to be restarted once in
a while when a ASP.NET page hangs.
When the ASP.NET page hangs, it's worker process is maxed out, but IIS
is still available and serving standard ASP pages.
An Adminstrator can restart IIS remotely via an ASP page that runs
IISRESET.EXE and allows normal operation to continue.
Here is the key peice of code:
set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C iisreset.exe >> C:\adminreset.log", 0, TRUE
set wshell = nothing
A User cannot run the ASP page because IISRESET.EXE returns an error:
Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to
use this
command. Either have your account added to the administrator local
group of
the remote computer or to the domain administrator global group.
Note:
I understand there are much better ways to handle the problematic
ASP.NET application/process, but for this case IIS MUST be reset from a
Web Page or Application with normal User rights. Power User could
possibly be allowed, but it has to work for Users that are not
Administrators. Cases may arise where only a standard User is available
to perform the manual restart/reset.
Allow domain users the ability to reset / restart IIS remotely without
Administrator rights.
Scenario:
A certain server is running IIS 5.0 which needs to be restarted once in
a while when a ASP.NET page hangs.
When the ASP.NET page hangs, it's worker process is maxed out, but IIS
is still available and serving standard ASP pages.
An Adminstrator can restart IIS remotely via an ASP page that runs
IISRESET.EXE and allows normal operation to continue.
Here is the key peice of code:
set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C iisreset.exe >> C:\adminreset.log", 0, TRUE
set wshell = nothing
A User cannot run the ASP page because IISRESET.EXE returns an error:
Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to
use this
command. Either have your account added to the administrator local
group of
the remote computer or to the domain administrator global group.
Note:
I understand there are much better ways to handle the problematic
ASP.NET application/process, but for this case IIS MUST be reset from a
Web Page or Application with normal User rights. Power User could
possibly be allowed, but it has to work for Users that are not
Administrators. Cases may arise where only a standard User is available
to perform the manual restart/reset.