Link to home
Start Free TrialLog in
Avatar of adamtrask
adamtrask

asked on

Attempting to use PowerShell's Get_Process on a remote computer

Hi,

I am trying to use Get-process on a remoter computer.
Here is what I use:
get-process -computerName 01212A-PC | where-object {$_.WorkingSet -gt 20000}

I get the following error:

Get-Process : couldn't connecto to a remote machine.
At Line:1 char:12
get-process <<<< -computerName 01212A-PC | where-object {$_.WorkingSet -gt 20000}
CategoryInfo  : NotSpecified: <:> [Get-Process],[InvalidoperationException
FullyQualified ErrorID : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetProcessComand


Please take into account that I am a novice in all this.

Thank you
Avatar of Miguel Angel Perez Muñoz
Miguel Angel Perez Muñoz
Flag of Spain image

Couple things could cause error:
- Remote powershell not enabled on destination computer (enable running enable-psremoting)
- User has not administrative permissions on remote computer (you can specify a user to run on remote computer with -credential
- Firewall blocks remote powershell (check remote firewall or disable to do a test)
- DNS or other network fault.
I agree with all the above reasons except the first.  PowerShell Remoting has no connection to this problem - it uses the WSMan protocol, while the remoting for the Get-Process command uses DCOM.  In that vain, the 3rd reason should be clarified as the firewall should allow DCOM traffic.
Why don't you just use tasklist from a command prompt?
You could Batch script this together in about 30 seconds if you just need the process information off of a remote PC.

Or use PSTools and grab the info that way?
Avatar of adamtrask
adamtrask

ASKER

Rob G

Would you give me an example to show me how to use tasklist to get the above information ?

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Rob G
Rob G
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.... this is very useful. Any suggestion for further reading on this?
Thank you
Adam,
Really depends on what you need.. feel free to reach out direct if you need something else.. or more info on commands.. Been doing Administration since DOS 6.22 so, it just comes with time i guess..