Solved

Attempting to use PowerShell's Get_Process on a remote computer

Posted on 2014-12-03
8
246 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 500 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

This article explains how to install and use the NTBackup utility that comes with Windows Server.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

688 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