October 6, 2015
Easily Manage a Service on a Remote Machine
For this example I will use Windows Remote Desktop Services and their ever needing service restart.
- Remote Restart Service
Get-Service -ComputerName yourremotecomputername -Name servicename | Restart-Service
- Example (Restart Remote Desktop Services)
Get-Service -ComputerName server1.domain.local -Name TermService | Restart-Service -Force
- The “-Force” is added to the end as TermSerivce has dependent services and this flag is required to restart TermSerivce as well as its depedencies
- From here you can explore other Service commands and options using this base syntax to get the service object on a remote machine.