How to restrict PowerShell for standard users without impacting Intune and CloudOps automation?

Dey, Dipronil 0 Reputation points
2026-08-07T14:35:26.7633333+00:00

We are looking for guidance on the best approach to restrict PowerShell execution on standard user workstations in our enterprise environment.

Current environment

Our Windows endpoints are managed through Microsoft Intune. Both the Intune team and CloudOps team use PowerShell extensively for day-to-day operations, including device provisioning, configuration, software deployment, and other administrative/automation activities.

At the same time, we have a security requirement to prevent standard users from executing unauthorized PowerShell scripts or commands.

We have tested the following:

PowerShell Execution Policy = Restricted

Blocks execution of .ps1 scripts.

  However, users can still open PowerShell and execute commands interactively by typing or pasting the commands.
  
  **RemoteSigned**
  
     Blocks downloaded/Internet-originated unsigned scripts.
     
        However, users can potentially bypass this by unblocking the file, recreating the script locally, or executing the commands interactively.
        
        We are therefore considering **AppLocker or WDAC** to restrict PowerShell execution for standard users.
        

Concern

We do not want to implement a blanket AppLocker/WDAC rule that blocks powershell.exe for everyone because Intune and CloudOps automation legitimately depend on PowerShell.

For example, an Intune deployment may effectively use:

Intune Management Extension
        ↓
    powershell.exe
        ↓
   PowerShell script

If we block powershell.exe, we are concerned that Intune deployments, device provisioning, configuration scripts, or CloudOps automation could be impacted.

Requirement

We would like to achieve something similar to:

Standard User
    └── Interactive PowerShell
            → BLOCK

Intune Management / Device Management
    └── Required PowerShell scripts
            → ALLOW

CloudOps / Approved Automation
    └── Required PowerShell scripts
            → ALLOW

CMD
    └── Normal user access
            → ALLOW

Questions

What is Microsoft's recommended approach for restricting interactive PowerShell usage by standard users while continuing to allow PowerShell scripts executed by Intune Management Extension and approved administrative/automation processes?

Is AppLocker appropriate for this requirement, or should we use WDAC / App Control for Business?

Can AppLocker/WDAC rules distinguish between:

A standard user launching powershell.exe interactively

  Intune Management Extension executing PowerShell under its required security context
  
     CloudOps automation executing approved PowerShell scripts?
     
     What is the recommended way to identify and create allow rules for Intune and CloudOps PowerShell execution without creating overly broad exceptions?
     
     Does setting PowerShell Execution Policy to `Restricted` through GPO have any potential impact on Intune PowerShell scripts or scripts executed by the Intune Management Extension?
     
     Is there a Microsoft-recommended combination of controls such as:
     
        App Control/WDAC
        
           AppLocker
           
              PowerShell Execution Policy
              
                 PowerShell Constrained Language Mode
                 
                    Defender/EDR
                    
                       PowerShell logging
                       
                       that would provide strong restriction for standard users without disrupting enterprise management automation?
                       
                       What would be the recommended **pilot/testing approach** before deploying such a policy across production endpoints?
                       

Our main objective is to prevent standard users from bypassing script restrictions simply by opening PowerShell and pasting/typing the commands interactively, while ensuring that legitimate Intune and CloudOps PowerShell automation continues to function.

How to restrict PowerShell for standard users without impacting Intune and CloudOps automation?

We are looking for guidance on the best approach to restrict PowerShell execution on standard user workstations in our enterprise environment.

Current environment

Our Windows endpoints are managed through Microsoft Intune. Both the Intune team and CloudOps team use PowerShell extensively for day-to-day operations, including device provisioning, configuration, software deployment, and other administrative/automation activities.

At the same time, we have a security requirement to prevent standard users from executing unauthorized PowerShell scripts or commands.

We have tested the following:

PowerShell Execution Policy = Restricted

Blocks execution of .ps1 scripts.

  However, users can still open PowerShell and execute commands interactively by typing or pasting the commands.
  
  **RemoteSigned**
  
     Blocks downloaded/Internet-originated unsigned scripts.
     
        However, users can potentially bypass this by unblocking the file, recreating the script locally, or executing the commands interactively.
        
        We are therefore considering **AppLocker or WDAC** to restrict PowerShell execution for standard users.
        

Concern

We do not want to implement a blanket AppLocker/WDAC rule that blocks powershell.exe for everyone because Intune and CloudOps automation legitimately depend on PowerShell.

For example, an Intune deployment may effectively use:

Intune Management Extension
        ↓
    powershell.exe
        ↓
   PowerShell script

If we block powershell.exe, we are concerned that Intune deployments, device provisioning, configuration scripts, or CloudOps automation could be impacted.

Requirement

We would like to achieve something similar to:

Standard User
    └── Interactive PowerShell
            → BLOCK

Intune Management / Device Management
    └── Required PowerShell scripts
            → ALLOW

CloudOps / Approved Automation
    └── Required PowerShell scripts
            → ALLOW

CMD
    └── Normal user access
            → ALLOW

Questions

What is Microsoft's recommended approach for restricting interactive PowerShell usage by standard users while continuing to allow PowerShell scripts executed by Intune Management Extension and approved administrative/automation processes?

Is AppLocker appropriate for this requirement, or should we use WDAC / App Control for Business?

Can AppLocker/WDAC rules distinguish between:

A standard user launching powershell.exe interactively

  Intune Management Extension executing PowerShell under its required security context
  
     CloudOps automation executing approved PowerShell scripts?
     
     What is the recommended way to identify and create allow rules for Intune and CloudOps PowerShell execution without creating overly broad exceptions?
     
     Does setting PowerShell Execution Policy to `Restricted` through GPO have any potential impact on Intune PowerShell scripts or scripts executed by the Intune Management Extension?
     
     Is there a Microsoft-recommended combination of controls such as:
     
        App Control/WDAC
        
           AppLocker
           
              PowerShell Execution Policy
              
                 PowerShell Constrained Language Mode
                 
                    Defender/EDR
                    
                       PowerShell logging
                       
                       that would provide strong restriction for standard users without disrupting enterprise management automation?
                       
                       What would be the recommended **pilot/testing approach** before deploying such a policy across production endpoints?
                       

Our main objective is to prevent standard users from bypassing script restrictions simply by opening PowerShell and pasting/typing the commands interactively, while ensuring that legitimate Intune and CloudOps PowerShell automation continues to function.

Microsoft Security | Intune | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-08-07T14:36:10.8866667+00:00

    Use App Control for Business (WDAC) as the primary control, not execution policy, for this requirement.

    Key points supported by Microsoft guidance:

    1. Execution policy is not sufficient for interactive restriction Restricted blocks .ps1 files, but the requirement is to stop users from opening PowerShell and typing or pasting commands. The supported control for that scenario is application control, not execution policy.
    2. Prefer App Control for Business over AppLocker Microsoft states that App Control for Business is the preferred application control system for Windows and recommends implementing application control with App Control for Business rather than AppLocker. AppLocker still works, but Microsoft is no longer investing in it beyond security fixes.
    3. How App Control helps with the exact split needed Under a lockdown policy:
      • Interactive PowerShell runs in ConstrainedLanguage mode.
      • Scripts and modules are evaluated per file by policy.
      • Approved files can run in FullLanguage mode.
      • Unapproved files are either blocked or forced into ConstrainedLanguage mode, depending on policy.
      That maps closely to the goal of restricting standard-user interactive use while still allowing approved automation.
    4. What this means for Intune and approved automation The practical model is:
      • Keep PowerShell available on the device.
      • Use App Control policy so interactive sessions are constrained.
      • Explicitly approve trusted scripts/modules used by Intune and CloudOps so they can run as trusted content.
      • Treat all other scripts as untrusted so they are blocked or constrained by policy.
      Microsoft documents that the policy is defined in XML and contains the files allowed and signing certificates recognized by the policy. When applied, only approved files are allowed to load and run.
    5. How PowerShell distinguishes trusted vs untrusted under policy In noninteractive execution, PowerShell uses the App Control API to determine whether a file is:
      • allowed in FullLanguage
      • blocked
      • allowed only in ConstrainedLanguage
      This is the supported mechanism for allowing approved automation without broadly allowing all user-authored scripts.
    6. Recommended rule design To avoid overly broad exceptions:
      • Approve only the specific scripts, modules, or signing certificates used by approved automation.
      • Prefer explicit approvals over broad wildcard-style allowances.
      • For modules, Microsoft specifically recommends avoiding wildcard function exports and avoiding script dot-sourcing patterns that can create injection risk under lockdown.
    7. Audit-first pilot approach Start in Audit mode before enforcement.
      • PowerShell 7.4 supports App Control policies in audit mode.
      • In audit mode, behavior does not change, but PowerShell logs what restrictions would apply.
      • The documented event is Event ID 16387 in the PowerShellCore/Analytic event log.
      Recommended pilot sequence:
      1. Build the App Control policy on a test machine.
      2. Put the policy in Audit mode.
      3. Run the full Intune and CloudOps automation set on pilot devices.
      4. Review the PowerShell audit events to identify scripts/modules that would be constrained or blocked.
      5. Add only the necessary approvals for those trusted files or signing certificates.
      6. Move a small pilot group to Enforce mode.
      7. Expand gradually after validating provisioning, configuration, and deployment workflows.
    8. AppLocker fit AppLocker can control apps for specific users or groups and can allow or deny apps based on file properties. If AppLocker is already deployed, it can be used, but Microsoft recommends App Control for Business as the strategic choice.
    9. Important behavior under lockdown Even trusted scripts running in FullLanguage can still have some restrictions on a locked-down system. Microsoft documents examples such as restrictions around wildcard exports, certain type conversions in interactive constrained sessions, and Enter-PSHostProcess being disabled. This matters for testing because some automation may need adjustment even when trusted.
    10. Logging and layered controls A strong combination from the documented guidance is:
    • App Control for Business as the main enforcement layer
    • PowerShell logging enabled and collected
    • Latest supported PowerShell versions
    • Validation of script parameters to reduce injection risk

    What is not supported by the available documentation:

    • A documented Microsoft statement here that specifically maps Intune Management Extension process identity to a ready-made WDAC/AppLocker exception pattern.
    • A documented statement here on the exact impact of GPO execution policy Restricted on Intune Management Extension scripts.

    Based on the supported guidance, the safest Microsoft-aligned approach is:

    • Do not rely on execution policy for this objective.
    • Do not blanket-block powershell.exe.
    • Use App Control for Business to constrain interactive use and explicitly trust only approved automation content.
    • Pilot in Audit mode first, then enforce gradually.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

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.