
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get Connected Remote Desktop Users on Computers Using PowerShell
To get the user sessions on the remote computers using PowerShell, we need to use the cmd query command. First of all, we will get the user sessions on the local computer using the below command.
Example
query session
Output
Let’s see what are other supported parameters for the query session command.
Example
PS C:\> query session /? Display information about Remote Desktop Services 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.
To get the sessions on the remote computers, we can use /Server:ServerName switch.
Example
query session /server:Test1-win2k12
Output
Advertisements