Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Authenticated Users in multiple languages if possible #25

Open
tju-pwsh opened this issue Jan 25, 2021 · 1 comment
Open

Handle Authenticated Users in multiple languages if possible #25

tju-pwsh opened this issue Jan 25, 2021 · 1 comment

Comments

@tju-pwsh
Copy link

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
Copy link
Author

tju-pwsh commented Jan 25, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant