JohnKlann / How to  / Easily Manage a Service on a Remote Machine

Easily Manage a Service on a Remote Machine

For this example I will use Windows Remote Desktop Services and their ever needing service restart.

  1. Remote Restart Service
    1. Syntax
    2. Get-Service -ComputerName yourremotecomputername -Name servicename | Restart-Service
    3. Example (Restart Remote Desktop Services)
    4. Get-Service -ComputerName server1.domain.local -Name TermService | Restart-Service -Force
    5. 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
  2. From here you can explore other Service commands and options using this base syntax to get the service object on a remote machine.