restarting IIS from within ASP.NET

S

Simon Weaver

I want to restart IIS from within ASP.NET from a WAP enabled phone.
That way if I'm on the beach and the server slows down I can just restart it
manually. I'd also like to be able to programatically kill other executables
on demand (i.e. please dont stop me and tell me that IIS restarts itself).

There is a pskill.exe executable available from sysinternals.com which works
just fine. BUT I cannot get it to run because it doesnt have enough
permissions.

process = new System.Diagnostics.Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.FileName = "pskill.exe";
process.StartInfo.Arguments = "consoleappserver.exe";
process.Start();

I want to minimize the security risk of opening security to allow this to
run,
although all code on the server is trusted. NB. I have rights to pskill.exe,
its just
that program that cannot run anything.

The error I get is:

PsKill v1.03 - local and remote process killer Copyright (C) 2000 Mark
Russinovich http://www.sysinternals.com Unable to kill process
consoleappserver.exe: Access is denied.

Note: even if the ASPNET Username has started the consoleappserver.exe
process it
still cannot kill it.

-Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top