?
Solved

Attempting to use PowerShell's Get_Process on a remote computer

Posted on 2014-12-03
8
Medium Priority
?
252 Views
Last Modified: 2014-12-03
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
0
Comment
Question by:adamtrask
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 19

Expert Comment

by:Miguel Angel Perez Muñoz
ID: 40478685
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.
0
 
LVL 40

Expert Comment

by:footech
ID: 40478867
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.
0
 
LVL 6

Expert Comment

by:Rob G
ID: 40478889
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?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:adamtrask
ID: 40479255
Rob G

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

Thank you
0
 
LVL 6

Accepted Solution

by:
Rob G earned 2000 total points
ID: 40479293
Start a Command prompt as Administrator..

tasklist /SVC /

TASKLIST /S system /U domain\username /P Password /SVC >C:\TasklistFromThatComputer.txt


English:
Tasklist is taskmanager but will provide further details including what is listed under service hosts, by using the /svc switch..

/S = System or the computer or IP address of a computer remotely to pull the data back from.
/U = Domain\Username
/P = Password, you are going to want to use either the domain admin account, or use an account that has domain admin access.. It helps to do this, as otherwise you may get errors that state you don't have access.
 >C:\TasklistFromThatComputer.txt = writes the information to that file.




If you already have domain admin access you can just use.. .
Tasklist /S System Name /svc >c:\PCNAMEoutput.txt

Output will give you this:

Running image name                                             PID Number                    Service associated


Assuming you are doing this for troubleshooting..
You can follow this up with taskkill commands to kill processes based on PID number..
0
 

Author Comment

by:adamtrask
ID: 40479378
Thank you.... this is very useful. Any suggestion for further reading on this?
0
 

Author Closing Comment

by:adamtrask
ID: 40479383
Thank you
0
 
LVL 6

Expert Comment

by:Rob G
ID: 40479411
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..
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question