Skip to content

Instantly share code, notes, and snippets.

@Riebart
Created January 5, 2021 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Riebart/f4e9960d7d13fbbe22da540f222ec9f8 to your computer and use it in GitHub Desktop.
Save Riebart/f4e9960d7d13fbbe22da540f222ec9f8 to your computer and use it in GitHub Desktop.
Disconnect the first active session on Windows and reconnect the console session. Useful for disconnecting RDP to use Steam Streaming.
$session=(query session | select-string Active)[0].ToString().split(" ")[0].substring(1)
Start-Process -verb runas tscon -ArgumentList "$session /dest:console"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment