Usually applications have windows services to be started / stopped , why have a Windows Administrator login and start / stop a service when this can be done remotely from the Asp.net Web site itself?

To accomplish this you need to add System.ServiceProcess reference in your application. This namespace holds ServiceController Class to access the windows service. By default, IIS application runs under ASP.NET account which doesn't have access rights permission to windows service. So, main thing is  Impersonation. You need to impersonate the application/part of the code with the User Credentials which is having proper rights and permission to access the windows service. Unless, If you try to access windows service it will generate "access denied" error. To Overcome this you can  impersonate the application by adding Identity tag in web.cofig as:

<identity impersonate="true" userName="XYZ" password="XYZ"/>

under System.Web and the user impersonated should have rights to access the Windows Service

You can just call ServiceController class  Start() and Stop() methods to start or stop a window service.

 

 

//Code to start the windows service

public void StartService()
    {
        try
        {
            ServiceController sc = new ServiceController();
             sc.ServiceName = "Servicename";
            if (sc.Status != ServiceControllerStatus.Running && sc.Status != ServiceControllerStatus.StartPending)
            {
                sc.Start();
            }
      }
        catch (Exception ex)
        {
             throw ex;
        }
 }

//Code to stop the windows service

 public void Stopservice()
    {
        try
        {
            ServiceController sc = new ServiceController();            
            sc.ServiceName = "Servicename";
            if (sc.Status == ServiceControllerStatus.Running)
            {
                sc.Stop();
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }
  }

//Code to check the status of the windows service

 public List<string> ServiceStatus()
    {
        try
        {
	    List<string> serviceList = new List<string>();
            string[] services = new string[] { "service1", "service2", "service3", "service4" };
           ServiceController sc = new ServiceController();
	    foreach (string servicesname in services)
            {
                sc.ServiceName = servicesname;
                if (sc.Status == ServiceControllerStatus.Stopped)
                {
                    serviceList.Add("Stopped");
                  
                }
                else { serviceList.Add("Running"); }
            }
            return serviceList;
        }
        catch (Exception ex)
        {
            throw ex;
        }

    }