Created
August 14, 2014 21:30
-
-
Save vinyar/311c78091e7e1d1f86ff to your computer and use it in GitHub Desktop.
Applying audit policies to Registry via Powreshell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $sddl = 'O:BAG:SYD:PAI(A;CI;KA;;;CO)(A;CI;KA;;;SY)(A;CI;KA;;;BA)(A;CI;KR;;;BU)(A;CI;KR;;;AC)S:AI(AU;CISA;KA;;;WD)' # alternative just in case | |
$acl = get-acl HKLM:\\SOFTWARE -audit | |
$audit = "Everyone","FullControl","containerinherit","none","Fail" | |
$rule = new-object system.security.accesscontrol.registryauditrule $audit | |
$acl.SetAuditRule($rule) | |
# $acl.SetSecurityDescriptorSddlForm($sddl) # alternative just in case | |
set-acl -Path HKLM:\\SOFTWARE -AclObject $acl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment