Skip to content

Commit

Permalink
Update tiny11maker.ps1
Browse files Browse the repository at this point in the history
Make adminRole dynamic for non english OS users to prevent errors during script execution
Related to ntdevlabs#160
  • Loading branch information
juliendevops committed May 17, 2024
1 parent cd8b9a7 commit 5b81a93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tiny11maker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ $adminSID = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-54
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$adminRoleSID = Get-LocalUser | Where-Object {$_.sid -like "S-1-5-21*-500"}
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::($adminRoleSID.name)
if (! $myWindowsPrincipal.IsInRole($adminRole))
{
Write-Host "Restarting Tiny11 image creator as admin in a new window, you can close this one."
Expand Down

0 comments on commit 5b81a93

Please sign in to comment.