Script Library

Boost your management, troubleshoot, and remediation capabilities with scripts created by experts in the IT community.

<< Back to Script Library

Tag: logoff

(6 Scripts)
This script finds a user session based on username and machine. This user is then logged off, even if the session is locked.
Version: 2.32.50  |   Created: 2020-01-26  |   Modified: 2023-11-24  |   Creator: Ton de Vreede  |   Downloads: 241
Logs off the selected user session
Version: 2.1.2  |   Created: 2019-01-27  |   Modified: 2022-12-14  |   Creator: ek  |   Downloads: 3637
Logoff disconnected sessions on the selected computer(s) which have been disconnected in excess of a given period, specified in minutes.
Disconnected period - the time in minutes over which a user must have been disconnected before they are logged off (default is 10 minutes)
Version: 1.3.3  |   Created: 2018-10-13  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 386
Cancels any "Message and Logoff" SBAs which are still running on the selected computer(s) by finding the associated PowerShell process and terminating it.
Cancellation Message - A message to display to the users so they can be informed that they will not be logged off (default is no mesage)
Version: 1.3.3  |   Created: 2018-10-12  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 47
Send a message to all connected sessions and then log them all off after a specified amount of time. The message can be repeated at a specified interval if required.
For instance, a delay of 15 minutes can be set and the users messaged every 5 minutes with the text specified in the "Message Text" argument.
When the configured script timeout of 60 seconds is reached, an error will be displayed but the script will keep running. If you need to cancel the logoff once the script has timed out, run the "Cancel Logoffs" SBA for the same computer(s)
Message Text - The text of the message to display to all connected users on the selected computer(s)
Delay Before Logoff - The period in minutes from when the script is invoked to when all users will be automatically logged off by the SBA
Message Every - how often, in minutes, the same message is displayed to the remaining users. Specify zero or a blank value to not repeat the message after the initial display
Version: 1.3.13  |   Created: 2018-10-12  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 201
Show user name, logon and logoff times of all users who have logged off, or been logged off, the selected computer(s) in the last x hours where x is an argument defaulting to 48. Useful to be able to spot if many users were logged off at a specific time.
Hours back to search - default is 48
User - optional user name to search for otherwise all users will be displayed
Version: 1.5.7  |   Created: 2018-07-18  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 186