-
|
I'm having issues with PowerShell execution policy when running remediation scripts through Intune. The scripts work locally but fail when deployed through Intune. What are the best practices for handling execution policy in this context? Any guidance would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Here's the solution for PowerShell execution policy issues in Intune remediation scripts: Root Cause: Solutions:
Best Practices:
This approach has resolved execution policy issues in my Intune deployments. |
Beta Was this translation helpful? Give feedback.
Here's the solution for PowerShell execution policy issues in Intune remediation scripts:
Root Cause:
Intune runs remediation scripts under the System account, which may have different execution policy settings than your local user account.
Solutions:
Use -ExecutionPolicy Bypass in your script calls:
Set execution policy at the beginning of your script:
Use Invoke-Expression for simple commands:
Ensure your detection scripts return proper exit codes:
Best P…