Convert-xRDS_SessionState.ps1
function Convert-xRDS_SessionState ([Parameter(Mandatory=$true)][int]$ObjectId) { # Convert user's session status ID into user friendly name [string]$OutInfo = $null; switch ($ObjectId) { 0 {$OutInfo= "Active"} 1 {$OutInfo= "Active, Minimized"} 2 {$OutInfo= "Query"} 3 {$OutInfo= "Shadow"} 4 {$OutInfo= "Disconnected"} 5 {$OutInfo= "Idle"} 6 {$OutInfo= "Listen"} 7 {$OutInfo= "Reset"} 8 {$OutInfo= "Down"} 9 {$OutInfo= "Init"} default {$OutInfo= "Unknown State"} } return $OutInfo } |