Start and stop windows services in MSD axapta by code

To Start and stop service in axapta by code You first add  reference System.Service Process in Application Object tree (AOT) on reference node after doing this you can add following code in job.

 System.ServiceProcess.ServiceController ServiceController1 = new  
  System.ServiceProcess.ServiceController();  
    ;  
    ServiceController1.set_MachineName(‘.’);  
    ServiceController1.set_ServiceName("IISADMIN");  
    ServiceController1.Stop();  
    sleep(500);  
    ServiceController1.Start();