ComputerManagementDsc
ComputerManagementDsc copied to clipboard
FilterAdministratorToken of UserAccountControl
Problem description
Based on MS documentation FilterAdministratorToken (https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gpsb/7c705718-f58e-4886-8057-37c8fd9aede1) is a registry key of type REG_DWORD. The key does not exists by default. Resource is creating a registry key with type REG_SZ instead of REG_DWORD
Verbose logs
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/Des
iredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer WIN-P0TLB4V9T38 with user sid S-1-5-21-4088093647-3395588363-3915767082-500.
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ Start Set ]
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ Start Resource ] [[UserAccountControl]FilterAdministratorTokenTest]
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ Start Test ] [[UserAccountControl]FilterAdministratorTokenTest]
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] Testing User Account Control state. (UAC0003)
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] Getting the current notification level of the User Account Control. (UAC0001)
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] The User Account Control property 'FilterAdministratorToken' was '', but expected it to be '0'. (U
AC0008)
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ End Test ] [[UserAccountControl]FilterAdministratorTokenTest] in 0.3110 seconds.
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ Start Set ] [[UserAccountControl]FilterAdministratorTokenTest]
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] Setting User Account Control state. (UAC0002)
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] Getting the current notification level of the User Account Control. (UAC0001)
VERBOSE: [WIN-P0TLB4V9T38]: [[UserAccountControl]FilterAdministratorTokenTest] Setting the property 'FilterAdministratorToken' to the value '0'. (UAC0009)
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ End Set ] [[UserAccountControl]FilterAdministratorTokenTest] in 0.1020 seconds.
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ End Resource ] [[UserAccountControl]FilterAdministratorTokenTest]
VERBOSE: [WIN-P0TLB4V9T38]: [] A reboot is required to progress further. Please reboot the system.
WARNING: [WIN-P0TLB4V9T38]: [] A reboot is required to progress further. Please reboot the system.
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ End Set ]
VERBOSE: [WIN-P0TLB4V9T38]: LCM: [ End Set ] in 3.4110 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 3.475 seconds
DSC configuration
Configuration TestConfig
{
Import-DscResource -Module ComputerManagementDsc -ModuleVersion 9.0.0
Node 'localhost'
{
UserAccountControl 'FilterAdministratorTokenTest'
{
IsSingleInstance = 'Yes'
FilterAdministratorToken = 0
}
}
}
Suggested solution
Create the registry key with the right type.
Operating system the target node is running
OsName : Microsoft Windows Server 2022 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
ame Value
---- -----
PSVersion 5.1.20348.1366
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.1366
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
ComputerManagementDsc version
Name Version Path
---- ------- ----
ComputerManagementDsc 9.0.0 C:\Program Files\WindowsPowerShell\Modules\ComputerManagementDsc\9.0.0\ComputerManagementDsc.psd1