Last updated: 2021-06-16

Source: https://support.freshservice.com/support/solutions/articles/50000003615-sample-usecase-start-a-windows-service-using-powershell

Powershell app enables seamless automation of complex administrative tasks on your remote Windows system. The scope of this app is not limited to the execution of a single Powershell command in one go; you can remotely trigger any of your pre-defined scripts on the remote system. The scripts are not limited to Powershell; you can trigger execution of python or ruby any other script on the remote host. The only condition is that the scripts should not have user interruptions.

How to start a Windows Service

In this use case, we will be starting the MySQL server windows service. This is done by pulling in the app action node with the following configuration:

App Node: Powershell - Orch

App Action: Execute Command

The ‘command’ input is the Powershell command to start a windows service as following -

Start-Service -Name "MSSQLSERVER"

You can get the name of the windows service with the following steps,

1. On your remote windows system, press Windows + R

2. Type services.msc

3. Search for your desired service from the services list

4. Double click on the service and copy the Service Name.