![]() ![]() Copy the four lines of code below (into memory).Launch PowerShell, the ISE GUI would be best.Pre-requisite: Visit Microsoft’s site and download the correct version of PowerShell for your operating system. In Windows Server 2003 days I choose the Alerter service for testing, partly because it’s relatively harmless service, and partly because its name is near the top of the list! However, since Alerter has been removed from Windows 7 and Server 2008, I have chosen PLA (Performance Logs and Alerts) to test PowerShell’s service cmdlets. Example 1: How to Start a Windows Service Incidentally, I believe in the maxim: ‘Any thing that you can do by clicking in a GUI, you can equal (or exceed) in a PowerShell script’. Good news a walk-through with the Services GUI reveals that if you switch a service from Disabled to Manual, then you can start it. The result of my preliminary experiment reveals that it’s not possible to start a service whose start-up type is currently set to, ‘Disabled’. It is also worth mentioning that another member of this family is called Restart-Service. We can also adapt the script to stop services, but that is less exciting. Our mission is to start one of your operating system’s services. Example 3: How to Restart a Service (Spooler).Example 1: How to Start a Windows Service.In order to get a grounding in the PowerShell syntax associated with this ‘Service’ family of commands, I suggest that you begin with my Get-Service page. If necessary, we can modify the script to stop, or even Restart the service. Our mission on this page is start a named Windows service. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |