PowerShell blocking scripts with AppLocker, not running in ConstrainedLanguage mode
Hi,
We have recently deployed an AppLocker policy to a number of users to limit execution of scripts by non-Admin users, which should result in scripts running in ConstrainedLanguage mode except for approved locations. All users are on Windows 11, with Entra-joined devices. They are using AppLocker script enforcement and the script rules do work fine. All users can run scripts in approved locations with FullLanguage mode.
For one user, they are unable to run any scripts from any non-approved location. AppLocker event log states the script was blocked and PowerShell does not open for them. Even a simple script like Read Host "test..."
will still fail to open. They previously had a profile that was being blocked, but have removed the profile and this error still occurs.
If they try to open it via a command (i.e powershell.exe -file <file>
or .\<file>
in powershell) they get:
<file> cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy.
If they right click and run with powershell, nothing happens.
All other users are able to run this file from any location, as it has nothing that would be blocked in ConstrainedLanguage mode.