Last active
January 3, 2016 05:49
-
-
Save belotn/8418024 to your computer and use it in GitHub Desktop.
list all session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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