PowerShell, List RDP Sessions

PowerShell
PowerShell, FileSystem Monitoring
11 maggio 2016
Kill-RDPs
PowerShell, Kill RDP Sessions
30 maggio 2016
Mostra tutto

PowerShell, List RDP Sessions

List-RDPs
A partire da Windows Vista, Microsoft ha resto disponibile l'utility Qwinsta che permette di visualizzare le informazioni sulle sessioni Remote Desktop.
Il post di oggi spiega come creare un semplice wrapper in PowerShell per Qwinsta.
function Get-RDPSessions {
    param(
        $ComputerName = "localhost"
    )

    qwinsta /server:$ComputerName |
    #Parse
    ForEach-Object {
        $_.Trim() -replace "s+",","
    } |
    ConvertFrom-Csv
}

Get-RDPSessions -ComputerName "localhost" | ft -AutoSize

pause
List RDP Session(s)

4 Comments

  1. Jeffrey Snover scrive:

    You should publish this as a script on the PSGallery!
    qwinsta – who is ever going to remember that name?

    Jeffrey Snover[MSFT]

    • Danfossi scrive:

      I do not think that such a simple script is worthy of being published on PSGallery! 😉
      In addition, I fear that if Microsoft staff doesn’t use more “qwinsta”, there is an easier method that currently escapes me! xD

  2. Demi scrive:

    Thanks a bunch for sharing this with all people you actually understand what you’re
    speaking approximately! Bookmarked. Kindly also seek advice from my site =).
    We could havve a link exchange arrangement between us!

  3. maillot foot pas cher scrive:

    Thanks for sharing, this is a fantastic blog.Really thank you! Awesome.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *