Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3139
  • Last Modified:

How to Issue "iisreset" command from ASP page

I've got a problem application that requires that the IIS services be restarted often.  I want to allow non administrators to reset the IIS services on this box by visiting a web page that gives them a button to execute this.

I wrote the code below and it is getting the following access denied error (below).  I have the virtual directory anonymous access running under local admin credentials on the box, so I'm not understanding this error.  I'm testing the code on XP SP3.

This is the output: "IIS Reset - 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 realize that this is not a good security practice, but desperate times call for ...
Sub IISReset()
  Set WshShell = CreateObject("WScript.Shell")
  Set strResponse = WshShell.Exec("iisreset")
  Set WshShell = Nothing
  Response.Write("IIS Reset - " & strResponse.stdOut.ReadAll())
End Sub

Open in new window

0
sarg_man
Asked:
sarg_man
  • 3
  • 2
  • 2
1 Solution
 
Saqib KhanSenior DeveloperCommented:
0
 
Praveen DMInfra Team LeadCommented:
give access to the IUSR_sitemachine name on CMD and then give a try...
0
 
Saqib KhanSenior DeveloperCommented:
> give access to the IUSR_sitemachine name on CMD and then give a try

Basiclay that means, "Come and Hack/Destroy my server"
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Praveen DMInfra Team LeadCommented:
hmmm yeah... thats what... Its the most risky permission that needs to be watched...
0
 
sarg_manAuthor Commented:
the web page is running under local admin privs.  I created a virtual directory and set the security to run as local admin.  The ASP page is access under that virtual dir.  In this case, the IUSR account shouldn't have anything to do with it, right?

adilkhan: I did look over the code the MS provided but don't think it is going to work since it calls methods to stop IIS services, then start them.   Once the services are stopped, the script is going to halt since the web page / script was being run by IIS.
0
 
Praveen DMInfra Team LeadCommented:
0
 
sarg_manAuthor Commented:
Never did get this one going, and the project has ended.  Closing...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now