DSC resources for for configuration of a Windows computer. These DSC resources allow you to perform computer management tasks, such as renaming the computer, joining a domain and scheduling tasks as well as configuring items such as virtual memory, event logs, time zones and power settings.
Details of the scenario you tried and the problem that is occurring
Trying to run the task in the specific time according to the local time zone (Stockholm) with daylight saving. Start-DscConfiguration works without issues. Test-DscConfiguration however, throws an error and returns ResourcesNotInDesiredState.
If I try with SynchronizeAcrossTimeZone = $false the code is executing without errors but then it looks like startup time is not corrected according to daylight saving.
If I keep SynchronizeAcrossTimeZone = $false but disable daylight saving on the target node, it is also executing without errors.
Verbose logs showing the problem
VERBOSE: [SWAZDB00]: LCM: [ Start Compare ]
VERBOSE: [SWAZDB00]: LCM: [ Start Resource ] [[ScheduledTask]CubeDefinitionDeployment]
VERBOSE: [SWAZDB00]: LCM: [ Start Test ] [[ScheduledTask]CubeDefinitionDeployment]
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Testing scheduled task
'Automatisk uppdatering av kubdefinitioner' in '\'.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Getting current scheduled
task values for task 'Automatisk uppdatering av kubdefinitioner' in '\'.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Task 'Automatisk uppdatering
av kubdefinitioner' found in '\'. Retrieving settings, first action, first trigger and repetition settings.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Detected schedule type
'Daily' for first trigger.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Current scheduled task values
for task 'Automatisk uppdatering av kubdefinitioner' in '\' retrieved.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Testing DSC parameter state.
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] NOTMATCH: Value (type
'System.String') for property 'StartTime' does not match. Current state is '2021-01-01T05:45:00+02:00' and desired
state is '2021-01-01T06:45:00+02:00'. (DRC0021)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.Boolean') for property 'SynchronizeAcrossTimeZone' does match. Current state is 'True' and desired state is
'True'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'ActionExecutable' does match. Current state is
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' and desired state is
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'ExecuteAsCredential' does match. Current state is 'C0NT0S00\_testuser1' and desired
state is 'C0NT0S00\_testuser1'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'TaskPath' does match. Current state is '\' and desired state is '\'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.UInt32') for property 'DaysInterval' does match. Current state is '1' and desired state is '1'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'ActionWorkingPath' does match. Current state is
'C:\AutomatiskUppdateringKubdefinitioner\Test' and desired state is 'C:\AutomatiskUppdateringKubdefinitioner\Test'.
(DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'ScheduleType' does match. Current state is 'Daily' and desired state is 'Daily'.
(DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] MATCH: Value (type
'System.String') for property 'TaskName' does match. Current state is 'Automatisk uppdatering av kubdefinitioner' and
desired state is 'Automatisk uppdatering av kubdefinitioner'. (DRC0020)
VERBOSE: [SWAZDB00]: [[ScheduledTask]CubeDefinitionDeployment] Test-DscParameter result is
'False'. (DRC0026)
VERBOSE: [SWAZDB00]: LCM: [ End Test ] [[ScheduledTask]CubeDefinitionDeployment] False in 0.2500 seconds.
VERBOSE: [SWAZDB00]: LCM: [ End Resource ] [[ScheduledTask]CubeDefinitionDeployment]
VERBOSE: [SWAZDB00]: LCM: [ End Compare ] Completed processing compare operation. The operation returned
False.
VERBOSE: [SWAZDB00]: LCM: [ End Compare ] in 0.3590 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Details of the scenario you tried and the problem that is occurring
Trying to run the task in the specific time according to the local time zone (Stockholm) with daylight saving.
Start-DscConfiguration
works without issues.Test-DscConfiguration
however, throws an error and returnsResourcesNotInDesiredState
.If I try with
SynchronizeAcrossTimeZone = $false
the code is executing without errors but then it looks like startup time is not corrected according to daylight saving.If I keep
SynchronizeAcrossTimeZone = $false
but disable daylight saving on the target node, it is also executing without errors.Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
8.4.0