Category filter

Script to block apps on Windows

As an organization’s IT administrator, you might have several reasons to block access to applications on company devices. Some common reasons include improving employee productivity, preventing malicious apps, restricting unwanted content and so on.

Using Hexnode’s Execute Custom Script action, you can remotely run the PowerShell script to block unwanted applications on your Windows endpoints without any manual intervention.


The sample scripts provided below are adapted from third-party open-source sites.

PowerShell Script to Block Apps

Specify the executable file names of the applications you want to block within double quotes and separated by commas, corresponding to the $blockListedApps variable in the PowerShell script. The specified apps will be blocked for all the user accounts signed into the device at the time of script execution.

When the user tries to launch a blocked app on the device, they will see a popup that informs them of the restriction.

Restrictions popup when the user tries to open a blocklisted app on Windows

To remove the application restrictions on the device, you can execute the PowerShell script below:


  • A device restart is required for the changes to take effect.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository