How can I programatically get the title for an active Remote Desktop Connection (mstsc.exe) session window?
<hostname or IP> – Remote Desktop Connection
The title is shown in two places:
- Task Manager, when you expand the Process “Remote Desktop Connection” under Apps.
- The title bar of an un-maximized Remote Desktop Connection window
I tried using the following commands and utilities:
- PowerShell command: Get-Process
- PowerShell command: Get-CimInstance Win32_Process | Select *
- Microsoft Sysinternals Process Explorer
- tasklist /v