mirror of
https://github.com/W4RH4WK/Debloat-Windows-10.git
synced 2024-11-17 15:25:37 +00:00
fix language specific "Administrators" string by using SID
ref #36 ref #37
This commit is contained in:
parent
27f6ba020c
commit
77bed6ec9d
@ -15,11 +15,14 @@ function Takeown-Registry($key) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get administraor group
|
||||||
|
$admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
|
||||||
|
$admins = $admins.Translate([System.Security.Principal.NTAccount])
|
||||||
|
|
||||||
# set owner
|
# set owner
|
||||||
$key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership")
|
$key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership")
|
||||||
$owner = [Security.Principal.NTAccount]"Administrators"
|
|
||||||
$acl = $key.GetAccessControl()
|
$acl = $key.GetAccessControl()
|
||||||
$acl.SetOwner($owner)
|
$acl.SetOwner($admins)
|
||||||
$key.SetAccessControl($acl)
|
$key.SetAccessControl($acl)
|
||||||
|
|
||||||
# set FullControl
|
# set FullControl
|
||||||
|
Loading…
Reference in New Issue
Block a user