ld0614 / LanguageDsc

Initial Release of LanguagePack Resource and early development release of Language Resource.
MIT License
2 stars 1 forks source link

Settings not being applied #5

Open arnekos opened 6 years ago

arnekos commented 6 years ago

Hi ld,

I'm using this config:

Import-DscResource -ModuleName LanguageDsc

Node 'localhost' {

    Language ConfigureLanguage {
        IsSingleInstance = "Yes" 
        LocationID = 176 
        MUILanguage = "nl-NL" 
        MUIFallbackLanguage = "nl-NL"
        SystemLocale = "nl-NL" 
        AddInputLanguages = @("0413:00020409") 
        RemoveInputLanguages = @("0409:00000409")
        UserLocale = "nl-NL"
        CopySystem = $true 
        CopyNewUser = $true
   }
}

And this is the verbose debug output:

PS C:\Windows\system32> Start-DscConfiguration -Verbose -Debug -Wait -UseExisting

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'. VERBOSE: An LCM method call arrived from computer TST-TST01 with user sid S-1-5-21-78199166-909048281-117498841-1183. VERBOSE: [TST-TST01]: [] Starting consistency engine. VERBOSE: [TST-TST01]: [] A pending configuration exists. DSC will process a set request on the pending configuration. DEBUG: [TST-TST01]: [DSCEngine] public enum NetBiosSetting { Default, Enable, Disable } VERBOSE: [TST-TST01]: LCM: [ Start Resource ] [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: LCM: [ Start Test ] [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Current User LocationID = 176 type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Current User MUILanguage = en-US type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Current User does not have a fallback language VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Current System Locale = nl-NL type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Currently Installed Languages = en-US en-GB nl-NL type string[] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Current UserLocale = nl-NL type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] System User LocationID = 176 type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] System User MUILanguage = en-US type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] System User does not have a fallback language VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] System Currently Installed Languages = en-US en-GB nl-NL type string[] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] System UserLocale = nl-NL type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New User LocationID = 176 type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New User MUILanguage = en-US type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New User does not have a fallback language VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New Installed Languages = en-US en-GB nl-NL type string[] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New UserLocale = nl-NL type string VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after LocationID: True VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New MUILanguage: nl-NL VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] New CUMUILanguage: en-US VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] MUILanguage Current User requires update VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] MUILanguage System User requires update VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] MUILanguage New User requires update VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after MUILanguage: False VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after MUIFallbackLanguage: False VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after SystemLocale: False VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after AddInputLanguages: False VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after RemoveInputLanguages: False VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Result after UserLocale: False VERBOSE: [TST-TST01]: LCM: [ End Test ] [[Language]ConfigureLanguage] in 0.3070 seconds. VERBOSE: [TST-TST01]: LCM: [ Start Set ] [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] Created XML is: VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:UserList> VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:LocationPreferences> VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:MUILanguagePreferences> VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:InputPreferences> VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:UserLocale> VERBOSE: [TST-TST01]: [[Language]ConfigureLanguage] </gs:GlobalizationServices> VERBOSE: [TST-TST01]: LCM: [ End Set ] [[Language]ConfigureLanguage] in 0.0920 seconds. VERBOSE: [TST-TST01]: LCM: [ End Resource ] [[Language]ConfigureLanguage] VERBOSE: [TST-TST01]: [] A reboot is required to progress further. Please reboot the system. Configuration will not be continued after the reboot. To continue configuration, use Start-DscConfiguration -UseExisting after reboot. WARNING: [TST-TST01]: [] A reboot is required to progress further. Please reboot the system. Configuration will not be continued after the reboot. To continue configuration, use Start-DscConfiguration -UseExisting after reboot. VERBOSE: [TST-TST01]: [] Consistency check completed. VERBOSE: Operation 'Invoke CimMethod' complete. VERBOSE: Time taken for configuration job to complete is 2.174 seconds

I don't know what I'm doing wrong. I'm new at DSC so it might be something simple.

Can you see what I'm doing wrong?

ld0614 commented 6 years ago

By the looks of it the resource isn't applying the configuration correctly but is generating the xml required to configure it. This suggests an issue when actually applying the configuration which is done with the control panel tool intl.cpl. If I remember correctly this writes its events to the Windows Logs\Setup log which should indicate if there was an error applying the XML.

The XML generated is everything between the verbose lines Created XML is: and [ End Set ] [[Language]ConfigureLanguage] in 0.0920 seconds. If you save that to a file and run the command

$arg = "intl.cpl,, /f:`"$env:TEMP\Locale.xml`""
Start-Process -FilePath control.exe -ArgumentList $arg

where $env:Temp\Locale.xml is the location of the xml file you should be able to simulate the resource without needing to run through DSC.

arnekos commented 6 years ago

I ran the simulation and can confirm that I can apply the xml with intl.cpl. That means that your hypotheses is correct.

I'm now trying to find the logs you are referring to. I've found other logs nl.:

Microsoft-Windows-International/Operational

and it contains errors. nl.:

Failed to change UI Language to "nl-NL". Status code is: 0xC000000D.

ld0614 commented 6 years ago

hmm, my guess is that the computer doesn't have the correct files to support the nl-NL language. Have you installed the language pack prior to running this?

arnekos commented 6 years ago

I've not installed any language pack. I was unaware that was required for that particular setting.

I've tried to use a language which does not require a languagepack nl. en-US

When I try to update the configuration (with en-US) the applying part succeeds (but no settings change) but I still get a reboot request and after that I continue the actuation with again the message that I should reboot.

Language ConfigureLanguage { IsSingleInstance = "Yes" LocationID = 176 MUILanguage = "en-US" MUIFallbackLanguage = "en-US" SystemLocale = "nl-NL" AddInputLanguages = @("0413:00020409") RemoveInputLanguages = @("0409:00000409") UserLocale = "nl-NL" CopySystem = $true CopyNewUser = $true } }

Sweggle commented 6 years ago

I'm also having the same issue. I'm trying to set to en-gb using the examples shown in this module. I've also tried to get the system to install the en-gb language pack first but i also get stuck in constant reboot loops. Is there anyway to fix this or should I revert to the XML file and script resource? I'm new to DSC, but happy to provide any output required. Thanks!

ld0614 commented 6 years ago

Are you testing that the settings have changed under your current account? By default DSC runs under the system account as such only the system account and any new users (if copy new user is set to true) will be affected. You should be able to use the PsDscRunAsCredential to run the code as the current user. This wouldn't affect a reboot loop though. @Sweggle would I be able to get a verbose output and a copy of the relevant parts of your DSC configuration as well as how you are currently applying the config.

Sweggle commented 6 years ago

Sure. Here is the config. I am applying via Azure Automation DSC

Prior to this i download the language pack via a script resource which is working fine, then..

LanguagePack en-GB { LanguagePackName = "en-GB" LanguagePackLocation = "C:\xxxSetup" DependsOn = '[Script]LanguagePackDownload'

}

& output from start-dscconfiguration command:

Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'. An LCM method call arrived from computer testvm1 with user sid The -Force option was specified with the Stop operation. The current configuration has been successfully cancelled. An LCM method call arrived from computer testvm1 with user sid [testvm1]: [] Starting consistency engine. [testvm1]: [] A pending configuration exists. DSC will process a set request on the pending configuration. [testvm1]: LCM: [ Start Resource ] [[File]xxxSetup] [testvm1]: LCM: [ Start Test ] [[File]xxxSetup] [testvm1]: [[File]xxxSetup] The destination object was found and no action is required. [testvm1]: LCM: [ End Test ] [[File]xxxSetup] in 0.0310 seconds. [testvm1]: LCM: [ Skip Set ] [[File]xxxSetup] [testvm1]: LCM: [ End Resource ] [[File]xxxSetup] [testvm1]: LCM: [ Start Resource ] [[Script]LanguagePackDownload] [testvm1]: LCM: [ Start Test ] [[Script]LanguagePackDownload] [testvm1]: [[Script]LanguagePackDownload] Begin executing test script. [testvm1]: [[Script]LanguagePackDownload] Executing script: $Status = ('True' -in (Test-Path 'C:\xxxSetup\Microsoft-Windows-Server-Language-Pack_x64_en-gb.cab')) $Status -eq $True [testvm1]: [[Script]LanguagePackDownload] End executing test script. [testvm1]: LCM: [ End Test ] [[Script]LanguagePackDownload] in 0.0470 seconds. [testvm1]: LCM: [ Skip Set ] [[Script]LanguagePackDownload] [testvm1]: LCM: [ End Resource ] [[Script]LanguagePackDownload] [testvm1]: LCM: [ Start Resource ] [[LanguagePack]en-GB] [testvm1]: LCM: [ Start Test ] [[LanguagePack]en-GB] [testvm1]: [[LanguagePack]en-GB] Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT MUILanguages FROM Win32_OperatingSystem,'queryDialect' = WQL,'namespaceName' = root\cimv2'. [testvm1]: [[LanguagePack]en-GB] Operation 'Query CimInstances' complete. [testvm1]: [[LanguagePack]en-GB] All installed Language Packs: en-US [testvm1]: [[LanguagePack]en-GB] Language Pack Found: False [testvm1]: [[LanguagePack]en-GB] Actual Result Returned: False [testvm1]: LCM: [ End Test ] [[LanguagePack]en-GB] in 0.2030 seconds. [testvm1]: LCM: [ Start Set ] [[LanguagePack]en-GB] [testvm1]: [[LanguagePack]en-GB] Installing Language Pack [testvm1]: [[LanguagePack]en-GB] Waiting for Process to finish. Time Taken: 00:00:00.0156460 [testvm1]: [[LanguagePack]en-GB] Waiting for Process to finish. Time Taken: 00:00:10.0254656 [testvm1]: [[LanguagePack]en-GB] Waiting for Process to finish. Time Taken: 00:00:20.0383803 [testvm1]: LCM: [ End Set ] [[LanguagePack]en-GB] in 30.0860 seconds. [testvm1]: LCM: [ End Resource ] [[LanguagePack]en-GB] [testvm1]: [] A reboot is scheduled to progress further. Configuration will be continued after the reboot. [testvm1]: [] Consistency check completed. Operation 'Invoke CimMethod' complete. Time taken for configuration job to complete is 55.823 seconds

CaptainStealthy commented 3 years ago

@Sweggle Did you ever find a solution to this? I am facing the same problem, and being somewhat new to DSC still, I am kind of lost on what the issue is.

cc @ld0614

Edit: I should mention that the language I'm trying to apply (fr-CA) is installed on the server (2012 R2), and the control method above didn't throw any errors. But I need to run for a few hours, and the server is still rebooting, so I'll have to check later to see if the config was actually applied.