|
@ -27,7 +27,7 @@ function Takeown-Registry($key) { |
|
|
|
|
|
|
|
|
# set FullControl |
|
|
# set FullControl |
|
|
$acl = $key.GetAccessControl() |
|
|
$acl = $key.GetAccessControl() |
|
|
$rule = New-Object System.Security.AccessControl.RegistryAccessRule("Administrators", "FullControl", "Allow") |
|
|
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") |
|
|
$acl.SetAccessRule($rule) |
|
|
$acl.SetAccessRule($rule) |
|
|
$key.SetAccessControl($acl) |
|
|
$key.SetAccessControl($acl) |
|
|
} |
|
|
} |
|
|