Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / AppLocker: Configure Application Restriction Policies in Windows

November 19, 2025

AppLocker: Configure Application Restriction Policies in Windows

Using AppLocker security policies, administrators can block or allow specific applications to run on Windows. With Applocker, it is possible to restrict program execution for a specific user group while allowing others, such as administrators, to run them. This guide explains how to create and deploy AppLocker application access policies using GPO.

The AppLocker application control feature was originally available only on Enterprise editions of Windows. However, starting with Windows 10 version 2004 and all Windows 11 versions, these edition restrictions were removed, allowing AppLocker policies to be applied to Pro editions as well.

Previously, application launch restrictions could be implemented in Windows through the Software Restriction Policies (SRP). However, the SRP feature has been deprecated since the release of Windows 10 version 1803 and Windows Server 2019.

Let’s create a new domain GPO containing the AppLocker control settings using the domain Group Policy management snap-in gpmc.msc (in the same way you can configure Applocker settings on a standalone machine using the Local Group Policy editor),

  1. Create a new GPO and switch to edit mode.
  2. In order for the AppLocker policies to be applied to clients, the Application Identity service must be enabled and running (the AppIDSvc service by default is disabled in Windows).
  3. Navigate to Computer Configuration -> Windows Settings -> Security Settings -> System Services. Open the Application Identity service properties and enable the automatic startup. Run Application Identity service via GPO
  4. Then expand Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Application Control Policies -> AppLocker. You can create rules for four software categories here:

    Executable Rules – Executable files (.EXE and .COM).
    Windows Installer Rules – Windows Installer files (.MSI, .MSP, .MST).
    Script Rules – script files (.BAT, .CMD, .JS, .PS1, and .VBS).
    Packaged app Rules – APPX and MSIX Microsoft Store apps.
  5. In this example, we will create software control rules for executable files. So, right-click on Executable Rules and select Create Default Rules Create Default Rules in Applocker
  6. Several predefined rules will be created.

    Allow Everyone (All files located in the Program Files folder) – this rule enables users to run files from the Program Files directory.
    Allow Everyone (All files located in the Windows folder) – it allows users to run any file from the Windows directory.
    Allow BUILTIN\Administrators (All files) – members of the local Administrators group can run any file.

    Predefined rules
  7. For example, you may want to allow non-admin users to run a specific application, regardless of its version or where it is located on the disk.
  8. Create a new AppLocker rule. Select whether you want to Allow or Deny the executable file to run. Select the user group to which this policy will apply (by default Everyone). Configure AppLocker rule permissions
  9. Next, choose the conditions for the AppLocker rule. Three options are available:
    Publisher – it allows creating rules for signed files (files from a specific publisher). With this rule, you can select from the following options: publisher name, product name, executable file name, or file version.
    Path – specify the path to the directory or file to which the rule will be applied. You can either specify the full path to the EXE file or use the wildcard character (*). For example, the rule C:\MyAppFolder\* will apply to all executable files in the specified directory.
    File hash – rule can be used to identify an unsigned file based on its SHA-256 hash. This rule allows or denies execution of a file, regardless of its name or location on the disk. However, if the file version is changed (e.g., after a software update), the rule must be recreated for the new file hash.
    The following AppLocker-specific environment variables can be used when specifying paths in rules.

    Windows directory or driveAppLocker path variable
    Windows directory%WINDIR%
    System32 and sysWOW64%SYSTEM32%
    Windows installation drive%OSDRIVE%
    Program Files%PROGRAMFILES%
    Removable media (CD or DVD)%REMOVABLE%
    Removable storage device (USB flash drive)%HOT%

  10. We will create an AppLocker rule for a specific app by its publisher. Select the target executable file. Because the target file may be missing from the domain controller where the AppLocker rule is created, you can use a UNC path to select the file from the client computer over the network (for example, use the Windows admin share path format \\computer123\c$\tools\tcpview64.exe )
  11. I want to allow this file to run based on its name, regardless of the version. The slider should be moved to the File Name. Or, configure more flexible conditions using the Use custom values ​​option. Create application control rule for specific program
  12. In the Exceptions section, you can make exceptions to the rule by path, publisher, or file hash. For example, you can prevent old, vulnerable versions of apps from running or restrict them to certain folders. Add an exception to the AppLocker rule
  13. Set the new AppLocker rule name. list of AppLocker rules in GPO

Now, let’s create a rule that blocks users from running the AnyDesk.exe app.

  1. Add a new AppLocker rule
  2. The rule should prevent anyone from running the app. Select Action: Deny, User or Group: Everyone. AppLocker deny app from running
  3. Create a Publisher rule and browse for the AnyDesk executable.
  4. This rule should apply regardless of the file’s version or location. You can either completely deny the launch of files signed by the publisher O=ANYDESK SOFTWARE GMBH or restrict it by product name. Create a rule to block anydesk app by its name using AppLocker
  5. Such a rule will block the program from launching regardless of the directory where the executable resides or the actual file name.
Although local administrators are allowed to run any local executable files, a deny rule always takes precedence and will block execution.

To apply the AppLocker rules that you create to client computers, open the AppLocker properties in the GPO console. There are four types of rules available here:

  • Executable rules – rules for classical Win32 executable (Exe) files
  • Windows Installer rules – MSI installer rules
  • Script Rules – script execution rules
  • Packaged all Rules – rules for Microsoft Store AppX/MSIX Packages

By default, AppLocker rules are not applied. To apply rules to clients, you need to enable the Configured option and select whether you want to apply the rules in Audit only or in Enforce rules mode.

It is recommended to initially apply the rules in audit mode to test their impact on clients without actually blocking app execution

Enable AppLocker rules in the audit mode

Link the GPO with AppLocker settings to the target OU (it is strongly recommended to test the software restriction rules on test computers/OUs first).

After applying new Group Policy settings on a client, check how AppLocker rules work on it. Since the AppLocker rules are currently applied in audit mode, applications are not actually blocked from launching.

You can use Event Viewer logs to determine how AppLocker policies are triggered when specific executable files are launched. Open the Event Viewer console (eventvwr.msc) and navigate to Application and Services Logs -> Microsoft -> Windows -> AppLocker -> EXE and DLL.

When AppLocker detects an attempt to run a blocked executable file, it logs a warning with Event ID 8003 that includes the name of the blocked app.

%OSDRIVE%\TOOLS\ANYDESK.EXE was allowed to run but would have been prevented from running if the AppLocker policy were enforced.

If the application is permitted to run, Event ID 8002 will be added.

Event ID 8002: EXE was allowed to run but would have been prevented from running if the AppLocker policy were enforced

Test AppLocker rules under non-administrative user accounts, as the default rules allow administrators to run all applications without restrictions. Users must work within their sessions, launching the necessary programs and performing their standard daily tasks.

Review the apps that are blocked from running according to the audit events. You can use PowerShell to query the Event Viewer logs and get a list of apps blocked by AppLocker rules on a computer.

$TimeSpan = (Get-Date).AddHours(-24)
Get-WinEvent -FilterHashtable @{LogName = "Microsoft-Windows-AppLocker/EXE and DLL"; Id = 8003; StartTime = $TimeSpan } | Format-Table TimeCreated, Message -AutoSize

PowerShell: get a list of apps blocked by AppLocker rules

If the current application control policy blocks a required executable file, edit the AppLocker GPO to add a rule allowing that app to run.

After debugging the AppLocker rules in audit mode, you can apply them in enforced mode. To do this, change the Audit setting in the AppLocker policy to Enforce rules.

Enforce AppLocker rules

AppLocker will now block the launch of any programs that are not authorized or explicitly denied.

This app has been blocked by your administrator

This app has been blocked by your administrator Applocker policy

The event with ID 8004 will now be added to the Event Viewer, which contains the name of the blocked executable file.

%OSDRIVE%\TOOLS\ANYDESK.EXE was prevented from running.

Event id 8004: EXE was prevented from running

Manually creating separate rules for each allowed or blocked app in AppLocker is time-consuming and tedious. There are several tools that can speed up and improve the process of creating and implementing AppLocker rules.

The AppLocker configuration editor in the GPO console has an automatic rule generation feature. The administrator can select the Automatically Generate Rules option and specify a target folder on the reference machine. Then, AppLocker will generate a list of rules for all the software found on the computer.

Automatically generate AppLocker rules

You can also create AppLocker rules by importing them from individual computers. For example, you can get a list of blocked executable files from the Event Viewer logs using PowerShell:

Get-ApplockerFileinformation -Eventlog -EventType Audited|fl

Get-ApplockerFileinformation - list events

Based on this information, you can automatically add rules to the local AppLocker policy.

Get-ApplockerFileinformation -Eventlog -EventType Audited | New-ApplockerPolicy -RuleType Hash, Publisher -User jsmith -RuleNamePrefix AuditBased | Set-ApplockerPolicy –Merge

The new rules will be added to the computer’s local AppLocker policy. From there, they can be exported and imported to the domain GPO.

Import and Export the AppLocker policy settings from a standalone computer

List only blocked executable (including the number of attempts to run each file):

Get-AppLockerFileInformation -EventLog -EventType Denied -Statistics

Keep the following points in mind when creating AppLocker rules:

  • AppLocker deny rules take precedence over allow rules
  • By default, everything is prohibited unless it is explicitly allowed. In other words, an executable file is allowed to run only if it is explicitly allowed by a rule and not explicitly denied by any other rule.
  • Each rule may have exceptions. For example, this will allow certain rules to be applied to some groups of users while making exceptions for others. The screenshot shows how to use exceptions to allow PowerShell to run for administrators but block it for non-admin users (the article about disabling PowerShell on a computer is an example of implementing such a rule). AppLocker policy: allow only administrators to run the app.
  • When creating rules, keep in mind that groups like “Everyone” and “Domain Users” may also include administrators.

What about the possibility of temporarily suspending AppLocker on a computer? You might think that stopping the Application Identity service would prevent AppLocker rules from being applied. However, this is not true.

To temporarily disable AppLocker on a computer, first stop the AppIDSvc service and then delete the AppCache.dat, Exe.AppLocker, and Dll.AppLocker files from the C:\Windows\System32\AppLocker\ folder.

Where applied AppLocker policies are stored on a disk

Modern versions of Windows include an additional mechanism for controlling executable launches called Windows Defender Application Control (WDAC). Although it is slightly more complex to configure than AppLocker, it is the better choice thanks to its flexibility, scalability, and enhanced security. Unlike AppLocker, which operates only in user mode, WDAC can block code execution at both the kernel level (e.g., drivers) and user mode.
0 comment
0
Facebook Twitter Google + Pinterest
Group PoliciesQuestions and AnswersWindows 11Windows Server 2022
previous post
Remove the Max Path Length Limit (260-Characters) on Windows

Related Reading

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

Bridging Multiple Network Interfaces on Windows

November 21, 2024

Fix: Windows Update Tab (Button) is Missing from...

December 16, 2024

How to Prefer IPv4 over IPv6 in Windows...

April 15, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 23, 2025

How to Detect Which User Installed or Removed...

June 25, 2025

Find a Process Causing High Disk Usage on...

July 16, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • SMB over QUIC: Mount File Share over Internet without VPN on Windows Server 2025

    November 4, 2025
  • How to Find a Previous Computer Name in Windows

    October 28, 2025
  • Stop Windows Server from Auto-Shutdown Every Hour

    October 22, 2025
  • How to Delete a Windows Service via CMD or PowerShell

    October 16, 2025
  • Resource Fair Sharing in Windows Server Remote Desktop Services (RDS)

    October 6, 2025
  • How to Disable (Enable) Credential Guard in Windows 11

    October 6, 2025
  • Wrong Network Profile on Windows Server after Reboot

    September 30, 2025
  • How to Get Windows 10 Extended Security Updates After End-Of-Life

    September 24, 2025
  • Blocking NTLM Connections on Windows 11 and Windows Server 2025

    September 23, 2025
  • Windows Stucks at ‘Getting Windows Ready, Don’t Turn Off Computer’

    September 15, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Remove ‘Some Settings are Managed by Your Organization’ on Windows 11 or 10
  • How to Add or Remove Pinned Folders to Quick Access with PowerShell and GPO
  • Unlocking Active Directory User Accounts
  • Exclude a Specific User or Computer from Group Policy
  • Configure Windows to Auto Restart/Shutdown with Task Scheduler
  • Mapping SharePoint Online Library as Network Drive in Windows
  • Prevent Server Manager from Starting at Logon on Windows Server
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top