From: Vinki on
Hello everyone,

I have this application that stops and starts IIS admin. When I try to
stop the service. I get an error "Cannot open IISADMIN service on computer
'.'.". I tried changing the machine name to my machine name then also it does
not work.


Below is the code
ServiceController controller = new ServiceController();
//controller.MachineName = "CS1239876";
controller.MachineName=".";
controller.ServiceName = "IISADMIN";
string status = controller.Status.ToString();
if(status == "Running)
controller.Stop();

Can anyone please help me with this.

Any help will be appreciated.