{"id":7444,"date":"2023-11-15T22:18:05","date_gmt":"2023-11-15T22:18:05","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=7444"},"modified":"2023-11-15T22:18:07","modified_gmt":"2023-11-15T22:18:07","slug":"intune-proactive-remediations-clear-old-wdac-policy","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/intune-proactive-remediations-clear-old-wdac-policy","title":{"rendered":"Intune Proactive remediations &#8211; Clear Old WDAC Policy"},"content":{"rendered":"\n<p>How to clear old WDAC policy when new policy not deploying<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">#detection\r\n$oldcips = Get-ChildItem -Path \"C:\\Windows\\System32\\CodeIntegrity\\CiPolicies\\Active\" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-7))}\r\n\r\n\r\nif ($oldcips) {\r\n    Exit 1\r\n} Else {\r\n    Exit 0\r\n}\r\n\r\n\r\n catch{\r\n    $errMsg = $_.exeption.essage\r\n    Write-Output $errMsg\r\n }<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">#remediation\nGet-ChildItem -Path \"C:\\Windows\\System32\\CodeIntegrity\\CiPolicies\\Active\" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-7))} | Remove-Item -Force<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to clear old WDAC policy when new policy not deploying<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7444","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=7444"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7444\/revisions"}],"predecessor-version":[{"id":7445,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7444\/revisions\/7445"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=7444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=7444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=7444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}