Get-Query
1.2.0
dotnet add package Get-Query --version 1.2.0
NuGet\Install-Package Get-Query -Version 1.2.0
<PackageReference Include="Get-Query" Version="1.2.0" />
paket add Get-Query --version 1.2.0
#r "nuget: Get-Query, 1.2.0"
// Install Get-Query as a Cake Addin #addin nuget:?package=Get-Query&version=1.2.0 // Install Get-Query as a Cake Tool #tool nuget:?package=Get-Query&version=1.2.0
Get-Query
Module that uses query.exe to generate output to Object PowerShell (Collection). Replaces the deprecated PSTerminalServices module which is no longer supported, its output may be incomplete, is slower than query, and if an error occurs during loop processing (e.g. RPC is not available), the module terminates the script even if Jobs is used.
Used to monitor active user sessions in RDP farms: Windows-User-Sessions
VNC alternative for remote connection to users (based on RDShadow and WinForms GUI): RSA
The output is independent of operating system localization.
Get-Help Get-Query
Get-Query localhost
default
Get-Query 192.168.1.1 | ft
Get-Query 192.168.1.1.1 -proc
list of all user processes (default -user *)
Get-Query 192.168.1.1.1 -proc -user username
list of processes of the selected user
Use this construct to shadow the selected session:
$srv = "192.168.1.1"
$id = Get-Query $srv | Out-GridView -PassThru | Select-Object -ExpandProperty id
#$id = Get-Query $srv | Out-ConsoleGridView -PassThru | Select-Object -ExpandProperty id
mstsc /v:$srv /shadow:$id /control /noconsentprompt
Example:
> Get-Query
User : lifailon
Session : console
ID : 1
Status : Active
IdleTime : отсутствует
LogonTime : 03.02.2024 1:08
Get process list for selected user:
> Get-Query -proc -user Lifailon | Format-Table
User Session ID PID Process
---- ------- -- --- -------
lifailon console 1 10404 ipf_helper.exe
lifailon console 1 10444 osd_daemon.exe
lifailon console 1 10492 aciseposture...
lifailon console 1 10520 conhost.exe
lifailon console 1 10840 sihost.exe
lifailon console 1 10940 svchost.exe
lifailon console 1 10988 svchost.exe
lifailon console 1 10436 taskhostw.exe
lifailon console 1 11376 explorer.exe
lifailon console 1 11572 wisesystemmo...
lifailon console 1 11928 svchost.exe
lifailon console 1 12056 startmenuexp...
lifailon console 1 11220 runtimebroke...
lifailon console 1 12632 runtimebroke...
lifailon console 1 13068 senaryaudioa...
lifailon console 1 14312 ctfmon.exe
lifailon console 1 12956 tabtip.exe
lifailon console 1 14044 textinputhos...
lifailon console 1 14728 runtimebroke...
lifailon console 1 14408 windowsvirtu...
lifailon console 1 2792 lightshot.exe
lifailon console 1 2180 deepl.exe
lifailon console 1 2828 cefsharp.bro...
lifailon console 1 15476 cefsharp.bro...
lifailon console 1 15644 cefsharp.bro...
lifailon console 1 15736 cefsharp.bro...
lifailon console 1 15744 cefsharp.bro...
lifailon console 1 16200 diskinfo64.exe
lifailon console 1 10952 shellexperie...
lifailon console 1 16224 runtimebroke...
lifailon console 1 13672 applicationf...
lifailon console 1 16408 useroobebrok...
lifailon console 1 17256 dllhost.exe
lifailon console 1 16680 svchost.exe
lifailon console 1 8784 conhost.exe
lifailon console 1 12444 dllhost.exe
lifailon console 1 16784 everything.exe
lifailon console 1 2636 chrome.exe
lifailon console 1 9100 chrome.exe
lifailon console 1 16644 chrome.exe
lifailon console 1 11812 chrome.exe
lifailon console 1 4644 chrome.exe
lifailon console 1 2836 chrome.exe
lifailon console 1 8628 lockapp.exe
lifailon console 1 13884 runtimebroke...
lifailon console 1 24396 telegram.exe
lifailon console 1 17300 messagecente...
lifailon console 1 7612 chrome.exe
lifailon console 1 10392 comppkgsrv.exe
lifailon console 1 1992 conhost.exe
lifailon console 1 32764 conhost.exe
lifailon console 1 32832 rdcman-2.93.exe
lifailon console 1 37640 ivideonclien...
lifailon console 1 45300 conhost.exe
lifailon console 1 32096 pwsh.exe
lifailon console 1 48348 conhost.exe
lifailon console 1 32436 conhost.exe
lifailon console 1 53676 pwsh.exe
lifailon console 1 54072 conhost.exe
lifailon console 1 54384 chrome.exe
lifailon console 1 59440 svchost.exe
lifailon console 1 43652 svchost.exe
lifailon console 1 62320 dllhost.exe
lifailon console 1 64744 svchost.exe
lifailon console 1 63684 deepl.exe
lifailon console 1 47340 cefsharp.bro...
lifailon console 1 59596 cefsharp.bro...
lifailon console 1 62768 cefsharp.bro...
lifailon console 1 65512 cefsharp.bro...
lifailon console 1 66820 cefsharp.bro...
lifailon console 1 58440 systemsettin...
lifailon console 1 70856 qbittorrent.exe
lifailon console 1 68236 searchapp.exe
lifailon console 1 70824 googledrivef...
lifailon console 1 58592 crashpad_han...
lifailon console 1 74416 googledrivef...
lifailon console 1 4612 googledrivef...
lifailon console 1 62604 conhost.exe
lifailon console 1 64672 googledrivef...
lifailon console 1 50444 googledrivef...
lifailon console 1 74632 googledrivef...
lifailon console 1 74960 googledrivef...
lifailon console 1 93020 taskhostw.exe
lifailon console 1 88016 chrome.exe
lifailon console 1 93228 svchost.exe
lifailon console 1 83624 systemsettin...
lifailon console 1 91608 librehardwar...
lifailon console 1 94896 chrome.exe
lifailon console 1 94612 taskhostw.exe
lifailon console 1 99312 windowstermi...
lifailon console 1 100792 runtimebroke...
lifailon console 1 104788 pwsh.exe
lifailon console 1 103996 conhost.exe
lifailon console 1 98548 pwsh.exe
lifailon console 1 81376 conhost.exe
lifailon console 1 100596 notepad++.exe
lifailon console 1 105376 pwsh.exe
lifailon console 1 94760 conhost.exe
lifailon console 1 103576 pwsh.exe
lifailon console 1 46984 conhost.exe
lifailon console 1 107096 code.exe
lifailon console 1 101044 code.exe
lifailon console 1 101096 code.exe
lifailon console 1 102248 code.exe
lifailon console 1 87220 code.exe
lifailon console 1 95812 code.exe
lifailon console 1 106468 code.exe
lifailon console 1 99260 code.exe
lifailon console 1 100064 code.exe
lifailon console 1 86108 conhost.exe
lifailon console 1 96680 pwsh.exe
lifailon console 1 104852 code.exe
lifailon console 1 101652 java.exe
lifailon console 1 105020 conhost.exe
lifailon console 1 102872 pwsh.exe
lifailon console 1 106312 conhost.exe
lifailon console 1 97692 chrome.exe
lifailon console 1 104644 chrome.exe
lifailon console 1 101748 chrome.exe
lifailon console 1 88076 chrome.exe
lifailon console 1 103936 chrome.exe
lifailon console 1 101936 chrome.exe
lifailon console 1 103872 chrome.exe
lifailon console 1 101396 chrome.exe
lifailon console 1 103780 chrome.exe
lifailon console 1 99380 chrome.exe
lifailon console 1 97220 openconsole.exe
lifailon console 1 106588 pwsh.exe
lifailon console 1 100144 chrome.exe
lifailon console 1 95108 chrome.exe
lifailon console 1 105396 chrome.exe
lifailon console 1 95772 chrome.exe
lifailon console 1 104784 chrome.exe
lifailon console 1 102068 chrome.exe
lifailon console 1 109044 chrome.exe
lifailon console 1 109328 chrome.exe
lifailon console 1 107544 chrome.exe
lifailon console 1 107996 chrome.exe
lifailon console 1 110304 chrome.exe
lifailon console 1 56576 chrome.exe
lifailon console 1 110440 chrome.exe
lifailon console 1 110488 chrome.exe
lifailon console 1 109904 chrome.exe
lifailon console 1 100716 chrome.exe
lifailon console 1 103764 chrome.exe
lifailon console 1 95028 ffp-stream.exe
lifailon console 1 70932 conhost.exe
lifailon console 1 111548 ffp-stream.exe
lifailon console 1 103568 conhost.exe
lifailon console 1 109164 query.exe
lifailon console 1 107596 qprocess.exe
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.0 | 204 | 2/3/2024 |