S
S
Stepan Kuksenko2018-05-21 18:31:19
PowerShell
Stepan Kuksenko, 2018-05-21 18:31:19

How to get a list of all window titles on a remote PC?

There is a task to receive the list of all title of a window on the remote PC in an array.
I was able to get the list of windows into an array on my local computer as follows:

[array]$Titles = Get-Process | Where-Object {$_.mainWindowTItle} |Foreach-Object {$_.mainwindowtitle}

But how to get a list of windows on a remote PC? I tried to add the
-ComputerName parameter, but nothing is written to the array, it is NULL
Also tried through Invoke-Command
Invoke-Command -ComputerName "PCName" {
          [array]$Titles = Get-Process |  Where-Object {$_.mainWindowTItle} |Foreach-Object {$_.mainwindowtitle}  
       }

But it is also useless in this case, the array is empty. Tell me which way to dig))
Thank you in advance for your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
azarij, 2018-05-21
@stxtasy

doesn't work even if you crack - get-process does not transfer mainwindowtitle from remote machines! sort of like it's not supported by microsoftware. I'm looking for how else I can ...
UPD: nope, it doesn't work. and through get-ciminstance and get-wmiobject I couldn't get the window names from the remote machine either. It doesn't seem to be a bug, but a feature. so safer.

D
Dimonchik, 2018-05-21
@dimonchik2013

Remote Session Configuration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question