WDAC policy and Powershell constrained language mode

Yevhen UK 5 Reputation points
2024-01-10T19:12:40.5933333+00:00

Hello, if I understood these articles (1 , 2, 3) correctly, when WDAC is enabled, the Powershell session starts in constrained language mode. Please tell me how to allow users to run powershell in Full Language mode without disabling option 11 Disabled:Script Enforcement (Set-RuleOption –FilePath [path to the XML policy] –Option [enter the option number] –Delete) ? it is not very clear how to configure WDAC policies for Powershell. Thanks in advance for the examples and answers!

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Defender | Microsoft Defender for Identity
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Azar 31,610 Reputation points MVP Volunteer Moderator
    2024-01-10T20:43:39.6566667+00:00

    Hey Yevhen UK

    Let me help you, if you eant to configure WDAC policies to allow PowerShell

    Start with Using the Get-RuleOption cmdlet to identify the specific rules associated with PowerShell and constrained language mode.

    Get-RuleOption -FilePath [path to the XML policy] -Id 4101, 4102, 4103
    

    This will show you the current rules associated with PowerShell in your WDAC policy. Now Use the Set-RuleOption cmdlet to modify specific rule options. For example, you might change the EnforcementMode to "Audit" for PowerShell rules to allow monitoring without blocking.

    Set-RuleOption -FilePath [path to the XML policy] -Id 4101, 4102, 4103 -Option 11 -Value 0
    

    This sets the enforcement mode for the identified rules to "Audit" (0), allowing you to monitor without blocking.

    If this helps kindly accept the answer thanks very much.


  2. Andrew Huffman 0 Reputation points
    2025-06-26T20:39:33.5133333+00:00

    WDAC will only enforce Constrained Language mode on PowerShell scripts that are not signed with a trusted code signing script. If you sign the scripts with a trusted code signing certificate, they will be allowed to run in Full Language mode. I believe you may also need to trust/allow the code signing certificate in your WDAC policy.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.