- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-16-2022 02:38 PM
I'm new to EPM and I have an Elevate policy for installing some programs; however, I don't want these programs to install on Windows 11. I was thinking that Conditional Enforcement could help. Since it says, "Enforce when script returns 0", I made a simple PowerShell script that exits 0 when win10 is detected and exits 1 when win10 isn't detected.
Since these programs are only allowed by this policy, I would think that adding this script would break it for Windows 11 machines. Which is what I want.
However, the policy still allows me to install these programs on my Win11 machine. Am I doing something wrong or missing something obvious?
My script:
[string]$osname = (Get-WmiObject Win32_OperatingSystem).Caption
if ($osname -like "*Windows 10*") { exit 0 } else { exit 1 }
09-29-2022 01:26 AM
Seems like your idea should work. please make sure the policy arrived the endpoint. You can add few log file debug output to see that the script was indeed executed and return the correct result.
10-03-2022 02:00 PM
How do I get the extra debug output?
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

