dsccommunity / ComputerManagementDsc

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.
https://dsccommunity.org
MIT License
300 stars 83 forks source link

ScheduledTask - Integration Test Failure on WS2019 #352

Closed PlagueHO closed 3 years ago

PlagueHO commented 3 years ago

The Integration tests for ScheduledTask on WS2019 have recently started failing: https://dev.azure.com/dsccommunity/ComputerManagementDsc/_build/results?buildId=3431&view=logs&j=de978ee2-68a1-58a4-df18-d6018fff7e0b&t=801c2256-98eb-5af5-3ad4-305ba4a92848&l=4402 https://dev.azure.com/dsccommunity/ComputerManagementDsc/_build/results?buildId=3431&view=logs&j=de978ee2-68a1-58a4-df18-d6018fff7e0b&t=801c2256-98eb-5af5-3ad4-305ba4a92848&l=4532

It appears that it occurs in context "[ExecuteAs] No scheduled task exists but it should".

It seems to occur because the ExecuteAsCredential does not return the machine name on WS2019:

VERBOSE: [WIN-0UFA3MDU8F8]: [[ScheduledTask]ScheduledTaskExecuteAsAdd] NOTMATCH: Value (type 'System.String') for property 'ExecuteAsCredential' does not match. Current state is 'VssAdministrator' and desired state is 'WIN-0UFA3MDU8F8\VssAdministrator'. (DRC0021) VERBOSE: [WIN-0UFA3MDU8F8]: [[ScheduledTask]ScheduledTaskExecuteAsMod] NOTMATCH: Value (type 'System.String') for property 'ExecuteAsCredential' does not match. Current state is 'VssAdministrator' and desired state is 'WIN-0UFA3MDU8F8\VssAdministrator'. (DRC0021)

If we compare this on WS2016: VERBOSE: [fv-az433-359]: [[ScheduledTask]ScheduledTaskExecuteAsAdd] MATCH: Value (type 'System.String') for property 'ExecuteAsCredential' does match. Current state is 'fv-az433-359\VssAdministrator' and desired state is 'fv-az433-359\VssAdministrator'. (DRC0020) VERBOSE: [fv-az433-359]: [[ScheduledTask]ScheduledTaskExecuteAsMod] MATCH: Value (type 'System.String') for property 'ExecuteAsCredential' does match. Current state is 'fv-az433-359\VssAdministrator' and desired state is 'fv-az433-359\VssAdministrator'. (DRC0020)

Therefore it appears that some recent change to WS2019 has caused this change.