Skip to content

Hardcoded “Administrators” group name should use SID instead #505

@sergio-garciagil

Description

@sergio-garciagil

Currently, the code references the "Administrators" group name directly in the following line:

if err := addUserToGroup(ctx, k.UserName, "Administrators"); err != nil {
(

if err := addUserToGroup(ctx, k.UserName, "Administrators"); err != nil {
)

it's also happening in lines 131, 141 and 163

This approach fails on non-English Windows versions, where the group name differs (e.g., "Administradores" in Spanish or "Rendszergazda" in Hungarian).

💡 Suggested Fix:
Instead of using a hardcoded string, the code should reference the SID S-1-5-32-544, which is the universal identifier for the Administrators group across all Windows languages.

This ensures compatibility across different system locales.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions