I need to kill a process behind a service on a remote computer with PowerShell for a program/script I am creating.

The problem is that the process doesn't always have the same PID and the name is not always the same either. The only thing that always is the same is the name.

I have found out that I can get the PID of the service with this command:

```
taskkill /s rasmuspc /u rasmus123 /p 12345 /PID (Get-WmiObject Win32_Service|where{$_.Name -eq 'Spooler'}).ProcessID /F

```

I use this command to skip `tasklist`, so I can make it automated instead of manually looking up and typing in the PID.

But that command will only get the PID from my own computer, and I can't see is there a way to to get the PID of a service on a remote PC, only knowing the name of the service?