PowerTip: Use PoweShell to Start Service on Remote Machine

Doctor Scripto

Dr Scripto

Summary: Learn how to use Windows PowerShell to start a service on a remote machine.

Hey, Scripting Guy! Question How can I start a service on a remote machine?

Hey, Scripting Guy! Answer To start a service on a local machine:

Get-Service -Name bits  | Start-service

But if you try to use the same technique on a remote machine, it tries to start the service on your local machine:

Get-Service -Name bits  -ComputerName RSLAPTOP01 | Start-service

So you have to use Set-Service:

Get-Service -Name bits -ComputerName RSLAPTOP01 | Set-Service -Status Running

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment