added admin group support for all locales

This commit is contained in:
Oscar Krause
2025-04-17 14:41:35 +02:00
parent 0726e6abdd
commit f2f6f0ea60

View File

@@ -20,8 +20,12 @@ if ($dllPath) {
# Take ownership
takeown /F $fullPath | Out-Null
# Find "Admin Group" to support all locales e.g. "EN: administrators", "DE: Administratoren", ...
$adminGroup = ([System.Security.Principal.SecurityIdentifier] "S-1-5-32-544").Translate([System.Security.Principal.NTAccount]).Value
$adminGroupName = $adminGroup.Split('')[1]
# Grant full control to administrators
icacls $fullPath /grant Administratoren:F | Out-Null
icacls $fullPath /grant "$adminGroupName:F" | Out-Null
# Attempt to stop processes using the DLL (optional: may not apply to DriverStore)
Get-Process | Where-Object {