Solved

Attempting to use PowerShell's Get_Process on a remote computer

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

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
Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 
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

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now