Powershell Remote desktop sessions

This is a quick made script in 1 line that performs a query to a given list of servers where remote desktop is enabled

This is an alternative of using graphical mode on a broker

I’t can be upgraded next to identify session and log off the desired user ( future post )

The script has been modeled to be copy and paste in 1 line

Script for checking remote sessions in 1 line';
Note you can add servers in the @ array , as long you sepparate with " " and , 

1.Replace "server1" for your servername 
2.run this in just 1 line on power shell to have your list

$Servers = @("server1","server2",);Foreach ($i in $servers){echo "Server Remote Sessions of $i ";echo "******";qwinsta /server:$i;echo "******"}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.