Reputation: 39
like this :
get-process -computername cname | where-object {$_.mainwindowhandle -ne 0} | select-object name, mainwindowtitle
it is not work
Upvotes: 3
Views: 10205
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