Skip to main content

Uninstall Unapproved ScreenConnect Client

Summary

This script is intended for managed environments where only designated ScreenConnect Client instances are allowed.
It takes a parameter containing the names of approved ScreenConnect Client instances, verifies the input, and scans the system for all installed instances. Any instance not included in the approved list is silently uninstalled. The script records all actions and confirms that unapproved instances have been removed.

If the ApprovedInstances parameter is set to none, the script will uninstall every ScreenConnect Client instance present on the system.

EXERCISE EXTREME CAUTION – Double-check the InstanceIds before running the script. Using an incorrect InstanceId may result in the removal of integrated ScreenConnect Client.

Sample Run

Image1
Image2 Image6

User Parameters

NameExampleAccepted ValuesRequiredDefaultTypeDescription
ApprovedInstances56bd08847e48343f, 9df67d57637499f3TrueText StringA comma-separated list of approved ScreenConnect Client instance names (typically 16-character alphanumeric strings). If the value is set to 'none', the script will remove all installed instances of ScreenConnect Client from the system. Use this option with caution, as it will uninstall every ScreenConnect Client instance.

Task Creation

Script Details

Step 1

Navigate to AutomationTasks
step1

Step 2

Create a new Script Editor style task by choosing the Script Editor option from the Add dropdown menu
step2

The New Script page will appear on clicking the Script Editor button:
step3

Step 3

Fill in the following details in the Description section:

  • Name: Uninstall Unapproved ScreenConnect Client

  • Description: Removes all unapproved ScreenConnect Client instances from the system based on a provided list of approved instance names. If the ApprovedInstances parameter is set to none, all ScreenConnect Clients will be uninstalled. Double-check instance IDs to avoid removing required clients.

  • Category: Application

Image3

Parameters

ApprovedInstances

Locate the Add Parameter button on the right-hand side of the screen and click on it to create a new parameter.
AddParameter

The Add New Script Parameter page will appear on clicking the Add Parameter button.
AddNewScriptParameter

Configure the parameter as described below:

  • Parameter Name: ApprovedInstances
  • Required Field: True
  • Parameter Type: Text String
  • Default Value: False

Click the Save button to add the parameter.
Image7

Read the message that will appear after clicking the Save button and click the Confirm button to save the changes.
Image8

Script Editor

Click the Add Row button in the Script Editor section to start creating the script
AddRow

A blank function will appear:
BlankFunction

Row 1 Function: PowerShell

Search and select the PowerShell Script function.
AddPowerShell
AddedPowerShell

The following function will pop up on the screen:
BlankPowerShell

Paste in the following PowerShell script and set the Expected time of script execution in seconds to 3600 seconds. Click the Save button.

PowerShell Script

Image4

Row 2 Function: Script Log

Add a new row by clicking the Add Row button.
AddRow

A blank function will appear.
BlankFunction

Search and select the Script Log function.
AddScriptLogFunction

The following function will pop up on the screen:
BlankScriptLogFunction

In the script log message, simply type %Output% and click the Save button.
OutputScriptLogFunction

Save Task

Click the Save button at the top-right corner of the screen to save the script.
SaveButton

Completed Task

Image5

Output

  • Script logs

Changelog

2025-06-09

  • Initial version of the document