Script library

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

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)
Arguments:
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
View Script
Version: 1.3.13  •   Created: 2018-10-12  •   Modified: 2018-11-23
Run gpresult for the selected user to get a list of scripts that ran at logon and show where they are located, including the containing GPO's name and GUID, so that it is easy to view the script contents with a view to troubleshooting, optimising, etc. It also shows the size of the script, any parameters passed to it and when it was last modified
View Script
Version: 1.4.9  •   Created: 2018-10-05  •   Modified: 2018-11-20
Run the Sysinternals Process Monitor (procmon) utility for a specified amount of time for a selected process and see which files are most frequently accessed. If a path to an existing procmon executable is not given, it will be downloaded securely from the live.sysinternals.com site.
Arguments:
Monitor Period - the time in seconds to run the monitoring for. Monitoring for more than 60 seconds is not recommended as this can potentially impact system performance and disk space.
Backing file - if not specified this will be in the windowstemp folder on the system drive which on Citrix PVS booted systems can cause performance issues so specifying a file on a persistent local drive can help alleviate this potential issue.
Procmon Location - the location of an existing copy of procmon.exe. If not specified and internet connectivity is available, it will be downloaded.
View Script
Version: 3.10.47  •   Created: 2018-10-01  •   Modified: 2024-01-26
Show the average usage for each CPU over a specified period of time.
Can help to spot overloaded or over specified vCPU allocations for computers although the SBA should be run a number of times, particularly when under peak usage/load.
Arguments:
Capture Period - the number of seconds to monitor CPU usage for
View Script
Version: 1.5.10  •   Created: 2018-09-29  •   Modified: 2018-11-21
Cancel a reboot scheduled via the Schedule Reboot action by finding and deleting the scheduled task created by the Schedule Reboot action
View Script
Version: 1.5.13  •   Created: 2018-09-29  •   Modified: 2018-11-26
Schedule a reboot for a number of minutes/hours in the future by creating a scheduled task which runs once only. By default the reboot will not occur if there are logged on users or disconnected sessions in existence at the scheduled reboot time. This script will not message users, log them off or prevent further logons from occurring.
Arguments:
Minutes:hours - the number of hours/minutes in the future at which to schedule the reboot, e.g. 2:30 for 2 hours and 30 minutes in the future (default is 30 minutes)
Force - if set to true then the reboot will occur even if there are connected or disconnected user sessions at the time of the reboot (default is false)
Reason for Reboot - optional text which be placed in the event log.
View Script
Version: 3.5.11  •   Created: 2018-09-29  •   Modified: 2022-12-14
Capture and analyse network traffic sent for the specified process in a specified time period, showing the IP addresses and DNS names of the remote systems, the port used and the amount of data sent in the capture period.
Arguments:
Capture Time - the number of seconds to run a network capture for (default 15 seconds)
Show top - show only the top n destinations (default is 10)

Credits: based on "Capture Network IO for process" SBA by Andrew Morgan
View Script
Version: 1.6.8  •   Created: 2018-09-26  •   Modified: 2018-11-20
Capture and analyse network traffic sent for all processes in the specified session in a specified time period, showing the IP addresses and DNS names of the remote systems, the port used, the amount of data sent in the capture period and the processes involved.
Arguments:
Capture Time - the number of seconds to run a network capture for (default 15 seconds)
Show top - show only the top n destinations (default is 10)

Credits: based on "Capture Network IO for process" SBA by Andrew Morgan
View Script
Version: 1.4.8  •   Created: 2018-09-26  •   Modified: 2018-11-20
Capture and analyse network traffic sent for all processes on the selected computer in a specified time period, showing the IP addresses and DNS names of the remote systems, the port used, the amount of data sent in the capture period and the processes involved.
Arguments:
Capture Time - the number of seconds to run a network capture for (default 15 seconds)
Show top - show only the top n destinations (default is 10)

Credits: based on "Capture Network IO for process" SBA by Andrew Morgan
View Script
Version: 1.4.7  •   Created: 2018-09-26  •   Modified: 2018-11-20
Capture and analyse network traffic received for all processes on the specified computer in a specified time period, showing the IP addresses and DNS names of the remote systems, the port used, the amount of data received in the capture period and the processes involved.
Arguments:
Capture Time - the number of seconds to run a network capture for (default 15 seconds)
Show top - show only the top n sources (default is 10)

Credits: based on "Capture Network IO for process" SBA by Andrew Morgan
View Script
Version: 1.4.8  •   Created: 2018-09-26  •   Modified: 2018-11-20
  • 30
  • of 45