How to get services on remote computers with PowerShell?

PowerShellMicrosoft TechnologiesSoftware & Coding

To get service on the remote computer(s), simply you need to add parameter – ComputerName and provide remote servers computer name or IP address.

In the below example, we are getting services information on remote computer Win7 which has Automatic start-type.

Get-Service -ComputerName Win7 | Where{$_.StartType -eq "Automatic"}

Similarly, you can connect multiple computers separated by comma (,) in – ComputerName parameter.

Get-Service -ComputerName Win7, TestPC | Where{$_.StartType -eq "Automatic"}

If you need to identify on which particular computer(s), services exist, you can use the machinename property. In the above example, we are adding a machine name property in Pipeline.

Get-Service -ComputerName Win7, TestPC | Where{$_.StartType -eq "Automatic"} |
Select MachineName, Name, Status
raja
Published on 22-Jan-2020 08:05:08
Advertisements