Fix localized enrollment recovery
This commit is contained in:
@@ -179,10 +179,14 @@ if ($PSCmdlet.ShouldProcess($installPath, 'Install and register the SGU Credenti
|
||||
|
||||
$acl = Get-Acl -LiteralPath (Split-Path $settingsPath -Parent)
|
||||
$acl.SetAccessRuleProtection($true, $false)
|
||||
# Resolve built-in identities by SID instead of localized display names.
|
||||
# "BUILTIN\Administrators" is not resolvable on every non-English client.
|
||||
$systemSid = [Security.Principal.SecurityIdentifier]::new('S-1-5-18')
|
||||
$administratorsSid = [Security.Principal.SecurityIdentifier]::new('S-1-5-32-544')
|
||||
$acl.AddAccessRule([Security.AccessControl.FileSystemAccessRule]::new(
|
||||
'SYSTEM', 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow'))
|
||||
$systemSid, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow'))
|
||||
$acl.AddAccessRule([Security.AccessControl.FileSystemAccessRule]::new(
|
||||
'BUILTIN\Administrators', 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow'))
|
||||
$administratorsSid, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow'))
|
||||
Set-Acl -LiteralPath (Split-Path $settingsPath -Parent) -AclObject $acl
|
||||
|
||||
New-Item -Path $classRegistryPath -Force | Out-Null
|
||||
|
||||
Reference in New Issue
Block a user