Tanaka Saito
Tanaka Saito

Reputation: 1100

Finding path of process on remote machine

You can use the following in Powershell to obtain the full path to where a specific process is running:

Get-Process | where{$_.Name -like "*iexplore*"} | Select Path

If I want to find this path for a service on a remote machine, I thought I could just utilise the following:

Get-Process -ComputerName $MyServer | where{$_.Name -like "*iexplore*"} | Select Path

However, this doesn't return anything. I can see that I can find the service itself with some details on current usage etc. but I cannot find the path for where the .exe file is located. (I also noticed I cannot see how many CPUs the process is using either).

Is there a way to find the path for the process?

Upvotes: 1

Views: 2227

Answers (1)

Avshalom
Avshalom

Reputation: 8889

Get-Process missing this, but you can use WMI:

Get-WmiObject -Class win32_process -ComputerName $MyServer -Filter 'name like "%iexplore%"' | select path

Upvotes: 3

Related Questions