I have been struggling with a problem for a while now... Basically, I am creating a PowerShell GUI that will allow admins in my organization to deploy Windows Defender Application Control (WDAC) policies through PowerShell with a user-friendly interface.
My boss requested that I put in a status label that shows whether a policy is currently in Audit Mode, Enforce Mode, or Disabled (does not exist). The disabled part I've got figured out, but I was wondering how I could take an existing SIPolicy.p7b file and check for Rule Option 3 (Audit Mode)?
I originally wanted to see if it was possible to convert the SIPolicy binary back to XML, but I'm afraid that's a lost cause.
My second idea was to create temporary dupes of SIPolicy from the original XML file, one with enforce mode, one with audit mode, and compare file hashes, but that requires the user to select the XML file initially or for the XML file path to be hardcoded in the script and I would strongly like to avoid that.
If anyone is familiar with WDAC, binary files, PowerShell, etc. and is able to help out with a solution or just some clarifying guidance, I would really appreciate it.
Sorry if this post isn't done very well, I've never posted on stack before haha!
Thank you!