Christopher Chan
Christopher Chan

Reputation: 39

How to get list of running applications on remote computer using PowerShell

like this :

get-process -computername cname | where-object {$_.mainwindowhandle -ne 0} | select-object name, mainwindowtitle

it is not work

Upvotes: 3

Views: 10205

Answers (2)

Keith Hill
Keith Hill

Reputation: 201632

Use PowerShell remoting if you can. That is, you need PowerShell V2 and need to enable PowerShell remoting on the remote system using Enable-PSRemoting -Force. Once you're done with that you should be able to run a command on the remote system like so:

$cred = Get-Credential
Invoke-Command -ComputerName $computer {Get-Process *mail* | Where {$_.MainWindowHandle} | Select Name,MainWindowTitle} -Cred $cred

If you're on a domain and your credentials are valid on the remote system, you don't need to specify them via the -Credentials parameter.

Upvotes: 1

CB.
CB.

Reputation: 60910

If you get empty values for the mainwindowtitle is correct beacause this property isn't avalaible for remote process. see MSDN for the NotSupportedException!

Upvotes: 2

Related Questions