Skip to content

UserRightsAssignment: Wrong translation for SID "S-1-5-114" on German systems results in failing to apply parts of the configuration #201

@TuemmlerKelch

Description

@TuemmlerKelch

Details of the scenario you tried and the problem that is occurring

I want to configure different user rights assignments on systems with varying languages. Unfortunately MS seem to have ignored their maxime to not use special characters in group names, when they named the following group:

SID English name German name
"S-1-5-114" Local account and member of Administrators group Lokales Konto und Mitglied der Gruppe "Administratoren"

This is then translated to NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe Administratoren, which is missing the quotation marks and thus fails applying, which can be seen in scesvr.log (see Verbose logs showing the problem)

When I go ahead and exchange
Identity = "S-1-5-114"
with
Identity = "NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe 'Administratoren'"
it will work on German systems, but obviously fail on every other system, which is why I prefer the SID approach (if it were working) ;)

Verbose logs showing the problem

AUSFÜHRLICH: Vorgang "CIM-Methode aufrufen" mit den folgenden Parametern durchführen, "'methodName' = SendConfiguratio
nApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfigurat
ion".
AUSFÜHRLICH: Vom Computer 'WIN-G0QKN0P7DN7' mit Benutzer-SID 'S-1-5-21-440314191-1097825595-1590867867-500' ist ein LC
M-Methodenaufruf eingegangen.
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ StartenFestlegen]
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ StartenRessource] [[UserRightsAssignment]Delegation]
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ StartenTesten ] [[UserRightsAssignment]Delegation]
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Testing S-1-5-114 is pre
sent on policy Enable_computer_and_user_accounts_to_be_trusted_for_delegation
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] NT-AUTORITÄT\Lokales Kon
to und Mitglied der Gruppe "Administratoren" does not have Privilege Enable_computer_and_user_accounts_to_be_trusted_f
or_delegation
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ BeendenTesten ] [[UserRightsAssignment]Delegation] in 0.3430 Sekunden.
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ StartenFestlegen] [[UserRightsAssignment]Delegation]
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Policy: Enable_computer_
and_user_accounts_to_be_trusted_for_delegation. Identity:
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Granting Enable_computer
_and_user_accounts_to_be_trusted_for_delegation rights to NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe "Administ
ratoren"
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Attempting to Set NT-AUT
ORITÄT\Lokales Konto und Mitglied der Gruppe "Administratoren" for policy Enable_computer_and_user_accounts_to_be_trus
ted_for_delegation
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Testing S-1-5-114 is pre
sent on policy Enable_computer_and_user_accounts_to_be_trusted_for_delegation
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] NT-AUTORITÄT\Lokales Kon
to und Mitglied der Gruppe "Administratoren" does not have Privilege Enable_computer_and_user_accounts_to_be_trusted_f
or_delegation
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: [[UserRightsAssignment]Delegation] Task did not complete su
ccessfully
AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ BeendenFestlegen] [[UserRightsAssignment]Delegation] in 1.3600 Sekunden.
Die PowerShell DSC-Ressource "MSFT_UserRightsAssignment" konnte die Funktion "Set-TargetResource" nicht ausführen.
Fehlermeldung: "Task did not complete successfully Detaillierte Informationen befinden sich in der Protokolldatei
%windir%\security\logs\scesrv.log."
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost

AUSFÜHRLICH: [WIN-G0QKN0P7DN7]: LCM: [ BeendenFestlegen]
Die Funktion 'SendConfigurationApply' war nicht erfolgreich.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost

AUSFÜHRLICH: Vorgang "CIM-Methode aufrufen" wurde abgeschlossen.
AUSFÜHRLICH: Die Ausführung des Konfigurationsauftrags hat 2.37 Sekunden gedauert.

Content of scesvr.log

Dienstag, 28. Januar 2025 14:00:52
----Konfigurationsmodul wurde erfolgreich initialisiert.----

----Konfigurationsvorlageninformationen werden gelesen...

----Benutzerrechte werden konfiguriert...
Konfigurieren von S-1-5-32-544.
Entfernen von SeEnableDelegationPrivilege.
Konfigurieren von NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe Administratoren.
Fehler 1332: Zuordnungen von Kontennamen und Sicherheitskennungen wurden nicht durchgeführt.
NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe Administratoren wurde nicht gefunden.
Fehler 18: Es sind keine weiteren Dateien vorhanden.

Konfiguration der Benutzerrechte wurde mit einem oder mehreren Fehlern abgeschlossen.

----Gruppenmitgliedschaft wird konfiguriert...

Konfiguration der Gruppenmitgliedschaft wurde erfolgreich abgeschlossen.

----64-Bit-Registrierungsschlüssel werden konfiguriert...

Konfiguration der Registrierungsschlüssel wurde erfolgreich abgeschlossen.

----32-Bit-Registrierungsschlüssel werden konfiguriert...

----Dateisicherheit wird konfiguriert...

Konfiguration der Dateisicherheit wurde erfolgreich abgeschlossen.

----Allgemeine Diensteinstellungen werden konfiguriert...

Konfiguration allgemeiner Diensteinstellungen wurde erfolgreich abgeschlossen.

----Verfügbare Anlagenmodule werden konfiguriert...

Konfiguration der Anlagenmodule wurde erfolgreich abgeschlossen.

----Sicherheitsrichtlinien werden konfiguriert...
Konfigurieren der Kennwortinformationen.

Konfiguration des Systemzugriffs wurde erfolgreich abgeschlossen.

Die Konfiguration der Registrierungswerte wurde erfolgreich abgeschlossen.

Konfiguration des Überwachungsprotokolls wurde erfolgreich abgeschlossen.

----Verfügbare Anlagenmodule werden konfiguriert...

Konfiguration der Anlagenmodule wurde erfolgreich abgeschlossen.

----Konfigurationsmodul wird deinitialisiert...

Suggested solution to the issue

I'd prefer MS renaming the group to not use quotation marks, but I don't think this is going to happen. The only solution I can come up with is to add a check to the resource to, if "Get-WinSystemLocale" returns any value with de-* in the name field, it translates S-1-5-114 to NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe 'Administratoren'

The DSC configuration that is used to reproduce the issue (as detailed as possible)

 Configuration UserRightsAssignment_Basic_Config
{
    Import-DscResource -ModuleName SecurityPolicyDsc

    Node localhost
    {

        UserRightsAssignment Delegation
        {
            Policy   = "Enable_computer_and_user_accounts_to_be_trusted_for_delegation"
            Identity = "S-1-5-114'"
            Force =             $true
        }
    }
} 
UserRightsAssignment_Basic_Config -Output C:\temp

The operating system the target node is running

Confirmed to be an issue on all systems I have checked so far (2012R2, 2016, 2019, 2022, W10, W11)
This is the machine I used for this issue:
OsName : Microsoft Windows Server 2016 Standard Evaluation
OsOperatingSystemSKU : 79
OsArchitecture : 64-Bit
WindowsBuildLabEx : 14393.6897.amd64fre.rs1_release.240404-1613
OsLanguage : de-DE
OsMuiLanguages : {de-DE}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.14393.6343
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.6343
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

SecurityPolicyDsc 2.10.0.0
ALSO checked 3.0.0-preview0006

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