Setting the Service Configuration

To set the service configuration on a server, you need to know which services should be running, whether the services are set to automatic or manual, and whether the services are stopped and disabled. While this information is routinely documented in the Microsoft Resource Kits, TechNet, and various white papers, there is also quite a bit of information you can obtain through Windows PowerShell to help in your decision-making. In the GetSpecificService.ps1 script, you can print the information you receive from Get-Service about a specific service. To do this, first assign the name of the service you are interested in to the variable $strService. Then use the Get-Service cmdlet, specify the -name parameter, and ...

Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.