Git Product home page Git Product logo

lazyts's Introduction

LazyTS

LazyTS is a PowerShell script to manage Sessions and Processes on local or remote machines. It allows you to Query/Disconnect/Stop session(s), Query/Stop process(es) and Send Interactive message to one or more sessions.

This tool is using the module PSTerminalService which relies on the Cassia .NET Library.I used Sapien PowerShell Studio 2014 to which make life easier if you want to start building WinForms tools and add PowerShell code.

alt text

Requirements

  • PowerShell 3.0
  • Cassia Library (included in the download)

LazyTS is relying on the Cassia .NET Library (A DLL file). This file need to be present in the same directory as the script (Either when you use the PS1 or EXE file)

Of course you also need the appropriate permission on the remote machine to be able to manage it. If the Cassia.dll is not present, the script won't start:

Alt text

Installation

Usage

  • Launch a PowerShell console with the account that will perform the action
  • Execute the powershell script LazyTS.ps1

Alt text

Main features

Querying session on local or remote machines

After entering the ComputerName, click on the button Sessions

Alt text

Disconnecting Session(s)

Select one session or multiple sessions and right click, click on Disconnect Session This will only disconnect the user, its session State will become "disconnected", but will remain opened on the host.

Alt text

When getting disconnected, the user will get the following window

Alt text Your Remote Desktop Services session had ended. Your network administrator might have ended the connection. Try connection again, or contact technical support for assistance

Stopping a Session(s)

Select one session or multiple sessions and right click, click on Stop Session This will close the session of the user without warning. Any current work in progress will be lost.

Alt text

Here is the confirmation window after you select "Stop Session" Alt text

Querying Processes

After entering the ComputerName, click on the button Process. This will list all the running processes (for all sessions) Alt text

Stopping Process(es)

Select one process or multiple processes and right click, click on Stop Process This will Stop the process(es) selected.

Alt text

Alt text

Sending Message(s)

After entering the ComputerName, click on the button Message. Note that you must select one session or one process in order to use this option (the script need to know which session(s) it should send the message to.

This will Send a message to the selected session. If multiple sessions are selected only one message will be sent to each session.

Alt text

Confirmation windows:

Alt text

Default message: "IMPORTANT: The Server is going down for maintenance in 10 minutes. Please save your work and logoff."

Message to send

Alt text

Example of message received by each session selected

Alt text

Remote Desktop: Shadow (since v1.1)

When right clicking on a row you'll have the possibility to open a Shadow RDP on a selected Session ID. After you request to View or Control the session, the user will get this message

Alt text "<samaccountname> is requesting to control your session remotely. Do you accept the request" Message showed to the user when trying to control his session id.

If the user deny the request, you'll get the following message

Alt text "The operator or administrator has refused the request"

lazyts's People

Contributors

lazywinadmin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lazyts's Issues

Export report to .csv

I need to export to csv format for regular server polling. I think this option will be useful for many admins.

Support for multiservers

Requested by Микки
"It will be great if you add the ability to add list of comma separated servers to the textbox and show list of all sessions from all servers in one grid."

exe file

great script, bit can you make exe file for it?
basically need to run as another one account, exe file will good solution

Support for RDS Collection

Requested by Микки and Dan Rayner:
"RDS farm works with Connection Broker and we can get list of RDS servers in farm from Broker with command Get-WMIObject -ComputerName -Class Win32_SessionDirectoryServer. For example, you can add checkbox "Connection Broker" to the Form, and program will requests list of servers in the farm and sessions from each server."

See MSDN on Win32_SessionDirectoryServer class: https://msdn.microsoft.com/en-us/library/aa383636(v=vs.85).aspx

Exception calling "GetSessions" with "0" argument(s): "No more data is available"

When getting sessions on a Windows 10 machine, when nobody is signed it I get this error:
[2020-04-01 10:23:44] HOSTNAME_HERE Get-TSSession Loading Error: Exception calling "GetSessions" with "0" argument(s): "No more data is available" [2020-04-01 10:23:44] HOSTNAME_HERE Unknown Error Last Error: Exception calling "GetSessions" with "0" argument(s): "No more data is available"

It would be more intuitive if it would return a blank list or an indication that the get-TSsession was succesfull but empty.

Also, it would be nice to clear the current session list when clicking on the Sessions button. If the Get-TSsession is not successful, the previous list is still showing.

LazyTS1

This tool is really great, merci beaucoup! :)

Issue in the context menu when selecting multiple users

Script: LazyTS

Reported By Peter: I notice that if you select User1 and then right click on User2, the context menu items will apply to User1.
So for example, User1 is highlighted, I right click on User2 and select Shadow, it will then shadow User1. Is it possible to change this behavior easily?
I know it may be tricky since you allow multiple selections, maybe something like "if right click user is selected show context menu for selected user/s, otherwise select right click user and show context menu for that user".

Reported via "Contact me" on lazywinadmin.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.