scheduled tasks is missing RestartOnFailure
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- powershell
- Área
- devops, operating-systems
Línea de trabajo
Comienza en el recurso ScheduledTask de ComputerManagementDsc y sigue cómo sus propiedades se convierten en el XML de Windows Task Scheduler. Compara la tarea generada con el XML ideal proporcionado, incluidos RestartOnFailure, el System principal, AllowStartOnDemand y la configuración de batería. Valida el resultado con Invoke-DscResource utilizando la configuración proporcionada e inspecciona el XML de la tarea exportada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem description
the autocertbinding uses a scheduled task that uses
<RestartOnFailure>
<Interval>PT10M</Interval>
<Count>3</Count>
</RestartOnFailure>
This currently does not appear to be settable. This is important to have it retry a few times on failure if the cert isn't fully ready or there was a odd binding issue with one of the iis sites.
Other values that arn't currently supported include: (pulled from an exported task)
setting currently defaults to this
<Principals>
<Principal id="Author">
<Actions Context="Author">
but there should be an option to set to System also
<Principals>
<Principal id="System">
<Actions Context="System">
and
allowstartondemand
and this line may need correcting
AllowStartIfOnBatteries = -not $settings.DisallowStartIfOnBatteries
DisallowStartIfOnBatteries doesn't exist anywhere else maybe should be
AllowStartIfOnBatteries = $settings.allowStartIfOnBatteries
Verbose logs
no logs
DSC configuration
I'll post the working one, the above args would need to be added
$invokeParams = @{
Name = 'ScheduledTask'
ModuleName = 'ComputerManagementDsc'
Method = 'test'
Property = @{
'taskname' = 'IIS-AutoCertRebind';
'taskpath' = '\Microsoft\Windows\CertificateServicesClient';
'ensure' = 'present';
'description' = 'Automatically rebinds IIS to new certificates when issued';
'actionexecutable' = 'c:\windows\System32\inetsrv\appcmd.exe';
'scheduletype' = 'OnEvent';
'eventsubscription' = '<QueryList><Query Id="0" Path="Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational"><Select Path="Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational">*[System[EventID=1001]]</Select></Query></QueryList>';
'runlevel' = 'Highest';
'user' = 'SYSTEM';
'actionarguments' = 'renew binding /oldcert:$(OldCertHash) /newcert:$(NewCertHash)';
'priority' = 7;
'startwhenavailable' = $false;
'runonlyifnetworkavailable' = $false;
'runonlyifidle' = $false;
'waketorun' = $false;
'hidden' = $false;
'EventValueQueries' = @{
"NewCertHash" = "Event/UserData/CertNotificationData/NewCertificateDetails/@Thumbprint";
"OldCertHash" = "Event/UserData/CertNotificationData/OldCertificateDetails/@Thumbprint"
}
}
}
Invoke-DscResource -Debug -Verbose @invokeParams
Suggested solution
I think it's just adding the new goodies.
Operating system the target node is running
win server 2016/2019
PowerShell version and build the target node is running
powershell 5.1
powershell 7 has an issue with Serialized XML is nested to deeply so I didn't use it for testing I think thats a different bug to be dealt with.
ComputerManagementDsc version
using 9.2.0 for this but the latest 10 didn't have it in its source code either so I don't think its fixed there either.
Ideal state
We could generate this in duplicate (this is what gets generated as a task if you export it if you enable autoiisbindings
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<URI>\Microsoft\Windows\CertificateServicesClient\IIS-AutoCertRebind</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id='0'><Select Path='Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational'>*[System[EventID=1001]]</Select></Query></QueryList></Subscription>
<ValueQueries>
<Value name="NewCertHash">Event/UserData/CertNotificationData/NewCertificateDetails/@Thumbprint</Value>
<Value name="OldCertHash">Event/UserData/CertNotificationData/OldCertificateDetails/@Thumbprint</Value>
</ValueQueries>
</EventTrigger>
</Triggers>
<Principals>
<Principal id="System">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>Queue</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
<RestartOnFailure>
<Interval>PT10M</Interval>
<Count>3</Count>
</RestartOnFailure>
</Settings>
<Actions Context="System">
<Exec>
<Command>%SystemRoot%\System32\inetsrv\appcmd.exe</Command>
<Arguments>renew binding /oldcert:$(OldCertHash) /newcert:$(NewCertHash)</Arguments>
</Exec>
</Actions>
</Task>
- Lenguaje dominante
- PowerShell
- Estrellas
- 338
- Forks
- 80
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dsccommunity/ComputerManagementDsc
-
chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
chore
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
-
chore
Dificultad 4/5 3-5 días Aptitud para principiantes 64/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de dsccommunity/ComputerManagementDsc
Issues similares
-
kind/bug needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
matrixorigin/matrixone#29223 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
copse-dev/agent-pane#2953 ·
-
bug ci-failure high priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
vllm-project/vllm-omni#7972 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
simonw/sqlite-utils#872 ·
-
bug good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
amponce/archive-movie-browser#166 ·