Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Can I copy an ACL from one registry key to another in PowerShell 2.0
  2. $acl = get-acl -path hkcu:softwarefoo
  3. $r = $acl.GetAccessRules( $true, $true, [security.principal.ntaccount] )
  4. $acl.RemoveAccessRuleAll( $r[0] )
  5. $acl.AddAccessRule( $r[0] )
  6. set-acl -path hkcu:softwarebar -aclobject $acl