Solved

Attempting to use PowerShell's Get_Process on a remote computer

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

828 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