I\'m a PowerShell novice (Bash is my thing normally) who\'s currently trying to obtain qwinsta output to show who is logged in as an \'rdpwd\' (rdesktop) user so that I can
a simple way
get list of active users only
$logonusers = qwinsta /server:ts33 | Out-String -Stream | Select-String "Active"
clears all the info up apart from the users, with -replace command
$logonusers = $logonusers -replace("rdp-tcp") -replace("Active") -
replace("rdpwd") -replace("#") -replace '\s+', ' ' -replace '[0-9]',' '
$logonusers
will then list all the active users.