-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScheduledTask: Resource is never in compliance when BuiltInAccount is used #323
Comments
Adding some additional information to this as I think #328 is a duplicate (will close #328): The ScheduledTask integration tests are failing when using a Service Account as the credential on Windows Server 2016. The tests fail because on Windows Server 2016 the BuiltInAccount does not match:
On Windows Server 2019 the logs show:
The tests fail because on Windows Server 2016 the BuiltInAccount does not match:
On Windows Server 2019 the logs show:
The tests fail because on Windows Server 2016 the ExecuteAsCredential does not match:
On Windows Server 2019 the logs show:
|
Thanks for raising @DelectableMechanisations BTW! I've got to fix this as part of PR #326 because the CI pipeline is currently in a failed state. So I'll test out your change in that PR and see if it works. |
I've managed to fix one of the problems: BuiltInAccount, but still working on the ExecuteAsCredential problem. |
Details of the scenario you tried and the problem that is occurring
I am trying to apply a configuration using the ScheduledTask resource and the BuiltInAccount property.
Whilst the configuration applies successfully, running Test-DscConfiguration always returns false.
This ultimately seems to boil down to the SYSTEM principal account name sometimes displaying as 'SYSTEM' and other times as 'NT AUTHORITY\SYSTEM'.
Verbose logs showing the problem
Suggested solution to the issue
My guess is that when commit 1ae52d5 was implemented it didn't go far enough to resolve the underlying issue OR a recent Windows Update has changed the operation of the Get-ScheduledTask cmdlet and the values it returned.
I believe a change needs to be made to source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1, most likely in the section of code below:
Current:
Proposed:
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)
master (version 8.1.0 downloaded from PowerShell Gallery)
The text was updated successfully, but these errors were encountered: