Discussion:
Resetting / Restarting IIS Remotely without Admin Rights
(too old to reply)
Neufusion
2006-09-06 20:20:48 UTC
Permalink
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.
Chris Crowe [MVP 1997 -> 2006]
2006-09-07 09:13:30 UTC
Permalink
You may be able to use the IIS Process Recycling tool.
http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/downloads/iis5rweb.mspx

Also you could write a com object (VB6) that issues the IIS reset command.
You would then use Component Services to configure the COM Object to run
using an Administrative account. so you end up with an ASP page that uses
Server.CreateObject("") which will then be running with a specific
administative account.

Chris
--
Chris Crowe [ IIS MVP - 1997 - 2006 ]
http://blog.crowe.co.nz
Post by Neufusion
Allow domain users the ability to reset / restart IIS remotely without
Administrator rights.
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.
set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C iisreset.exe >> C:\adminreset.log", 0, TRUE
set wshell = nothing
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.
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.
Neufusion
2006-09-07 21:14:26 UTC
Permalink
Awesome... Great answers.

I can't use the IIS5 Process Recycling tool because it needs to be
reset manually on-demand. That is an awesome tool though. The same
functionality of this tool is now built in to Windows 2003 servers.

The COM object is the route I am going to take. It seems to be the most
secure approach with the least amount of administrative effort (once it
is built).

Thank You!
Post by Chris Crowe [MVP 1997 -> 2006]
You may be able to use the IIS Process Recycling tool.
http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/downloads/iis5rweb.mspx
Also you could write a com object (VB6) that issues the IIS reset command.
You would then use Component Services to configure the COM Object to run
using an Administrative account. so you end up with an ASP page that uses
Server.CreateObject("") which will then be running with a specific
administative account.
Chris
--
Chris Crowe [ IIS MVP - 1997 - 2006 ]
http://blog.crowe.co.nz
Post by Neufusion
Allow domain users the ability to reset / restart IIS remotely without
Administrator rights.
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.
set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C iisreset.exe >> C:\adminreset.log", 0, TRUE
set wshell = nothing
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.
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.
Manikandan
2009-06-30 12:52:46 UTC
Permalink
Create a batch file and run it.
----------------------------------------
@echo off
net stop W3SVC
net stop IISAdmin
net start IISAdmin
net start W3SVC
exit
------------------------------------

From http://www.developmentnow.com/g/59_2006_9_0_0_817129/Resetting-Restarting-IIS-Remotely-without-Admin-Rights.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com/g/

Loading...