Skip to content

Instantly share code, notes, and snippets.

@belotn
Last active January 3, 2016 05:49
Show Gist options
  • Save belotn/8418024 to your computer and use it in GitHub Desktop.
Save belotn/8418024 to your computer and use it in GitHub Desktop.
list all session
get-xaserver -FolderPAth $FOLDERPATH |% {
$sv = $_.ServerName; quser /SERVER:$($_.serverNAme) |% {
$arrT = @( $_ -Split ' ' |? { $_ -ne ' '-and $_.length -gt 0 } );
new-object PSobject -property @{"Session" = $arrT[1]; "Inact" = $arrT[6]; "ServerName" = $sv}
}
} |? { $_.Session -ne 'SESSION' } | sort Inact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment