{"id":584,"date":"2014-08-22T14:49:35","date_gmt":"2014-08-22T12:49:35","guid":{"rendered":"http:\/\/dety.net.ua\/?p=584"},"modified":"2014-08-22T14:51:24","modified_gmt":"2014-08-22T12:51:24","slug":"windows-server-2012-terminal-services-sessions-script","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=584","title":{"rendered":"Windows Server 2012 + Terminal Services + Sessions script"},"content":{"rendered":"<p>My script for connecting to the user&#8217;s sessions without GUI:<\/p>\n<blockquote><p>Write-host &#8220;Getting sessions list &#8230;&#8221;<br \/>\nGet-RDUserSession | ft Username, UnifiedSessionId, SessionState, HostServer -GroupBy Sessionstate<br \/>\n$sess = read-host &#8220;Enter session&#8217;s number: &#8221;<br \/>\nIf ($sess -ne &#8220;&#8221;)<br \/>\n{<br \/>\nMstsc \/shadow:$sess \/control \/noConsentPrompt<br \/>\nWrite-host &#8220;Connecting and exiting.&#8221;<br \/>\n}<br \/>\nElse<br \/>\n{<br \/>\nWrite-host &#8220;No sessions were choosen &#8211; Exiting.&#8221;<br \/>\n}<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>My script for connecting to the user&#8217;s sessions without GUI: Write-host &#8220;Getting sessions list &#8230;&#8221; Get-RDUserSession | ft Username, UnifiedSessionId, SessionState, HostServer -GroupBy Sessionstate $sess = read-host &#8220;Enter session&#8217;s number: &#8221; If ($sess -ne &#8220;&#8221;) { Mstsc \/shadow:$sess \/control \/noConsentPrompt Write-host &#8220;Connecting and exiting.&#8221; } Else { Write-host &#8220;No sessions were choosen &#8211; Exiting.&#8221; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-novosti","category-windows"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":2,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":586,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions\/586"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}