Windows10FeatureUpdates icon indicating copy to clipboard operation
Windows10FeatureUpdates copied to clipboard

Handle Authenticated Users in multiple languages if possible

Open tju-pwsh opened this issue 4 years ago • 1 comments

Copy-FeatureUpdateFiles does not set ACL rights properly on the folder ~FeatureUpdateTemp when running OS's in other languages as the group "NT AUTHORITY\Authenticated Users" is different from language to language (thus leading to ends users potentially deleting the folder if hidden files are shown).

tju-pwsh avatar Jan 25 '21 17:01 tju-pwsh

Issue possibly solved for multiple languages:

$BuiltinUsersSID = New-Object System.Security.Principal.SecurityIdentifier 'S-1-5-11' $BuiltinUsersGroup = $BuiltinUsersSID.Translate([System.Security.Principal.NTAccount]) $ACL = Get-Acl -Path $Path $ACL.SetAccessRuleProtection($True, $True) # Remove inheritance $ACL.Access | Where-Object {$.IdentityReference -eq $BuiltinUsersGroup} | ForEach-Object {$ACL.RemoveAccessRule($)} Set-ACL -Path $Path -AclObject $ACL | Out-Null # Apply ACL on folder

tju-pwsh avatar Jan 25 '21 17:01 tju-pwsh