Rexxer

Some tips for me and other

Windows Server 2012 + Terminal Services + Sessions script

My script for connecting to the user’s sessions without GUI:

Write-host “Getting sessions list …”
Get-RDUserSession | ft Username, UnifiedSessionId, SessionState, HostServer -GroupBy Sessionstate
$sess = read-host “Enter session’s number: ”
If ($sess -ne “”)
{
Mstsc /shadow:$sess /control /noConsentPrompt
Write-host “Connecting and exiting.”
}
Else
{
Write-host “No sessions were choosen – Exiting.”
}

Comments are currently closed.