Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - How can I check status of Terminal Services connections on remote server?

Reply
 
Old 01-07-2009   #1 (permalink)
Kevin Buchan


 
 

How can I check status of Terminal Services connections on remote server?

I want to write a script to alert people to log off when they leave a
Terminal Services session connected and idle on one of my servers.

I have googled and googled and I can't find a WMI or any other type of
query to let me read this informaion.

Any help is appreciated.
--
Kevin Buchan
kevin.buchan@xxxxxx[nospam]sanders.com


My System SpecsSystem Spec
Old 01-07-2009   #2 (permalink)
Charlie Russel - MVP


 
 

Re: How can I check status of Terminal Services connections on remote server?

Take a look at the "query" command. That should get you the information on
session status, and you can parse it as you need to.

PSH> query /?
QUERY { PROCESS | SESSION | TERMSERVER | USER }

PSH> query session /?
Display information about Remote Desktop Sessions.

QUERY SESSION [sessionname | username | sessionid]
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER]
[/VM]

sessionname Identifies the session named sessionname.
username Identifies the session with user username.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server to be queried (default is current).
/MODE Display current line settings.
/FLOW Display current flow control settings.
/CONNECT Display current connect settings.
/COUNTER Display current Remote Desktop Services counters
information.
/VM Display information about sessions within virtual
machines.


--
Charlie.
http://msmvps.com/blogs/xperts64
http://mvp.support.microsoft.com/profile/charlie.russel

"Kevin Buchan" <kevin.buchan@xxxxxx[PlsDon'tSpam]sanders.com> wrote in
message news:241am4dn0iohonbmd8n4k4frbfg04p64db@xxxxxx
Quote:

>I want to write a script to alert people to log off when they leave a
> Terminal Services session connected and idle on one of my servers.
>
> I have googled and googled and I can't find a WMI or any other type of
> query to let me read this informaion.
>
> Any help is appreciated.
> --
> Kevin Buchan
> kevin.buchan@xxxxxx[nospam]sanders.com
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Having Vista X64 & terminal services printing error- found available hotfix for SERVER OS-- Vista print fax & scan
Windows 2008 print server at terminal services - printer driver problem Vista print fax & scan
Re: Printer in Remote desktop/Terminal services. Vista print fax & scan
Terminal Services - Remote Desktop Connection Vista General
Best edition of Vista for remote desktop? (terminal services) Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46