Solved

Attempting to use PowerShell's Get_Process on a remote computer

Posted on 2014-12-03
8
240 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
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 39

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Power shell Script - Help v2 7 22
Powershell File Sort 8 31
archive enable with Remote mailbox 7 21
RDS Licensing on Server 2012R2 5 19
This article explains how to install and use the NTBackup utility that comes with Windows Server.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

821 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