Log directory pruning retry events
Enregistrer les événements de nouvelles tentatives de nettoyage d’Active Directory
Explanation
Specifies whether or not to log events when the pruning service on a domain controller attempts to contact a computer before pruning the computer's printers.
The pruning service periodically contacts computers that have published printers to verify that the printers are still available for use. If a computer does not respond to the contact attempt, the attempt is retried a specified number of times, at a specified interval. The "Directory pruning retry" setting determines the number of times the attempt is retried; the default value is two retries. The "Directory Pruning Interval" setting determines the time interval between retries; the default value is every eight hours. If the computer has not responded by the last contact attempt, its printers are pruned from the directory.
If you enable this policy setting, the contact events are recorded in the event log.
If you disable or do not configure this policy setting, the contact events are not recorded in the event log.
Note: This setting does not affect the logging of pruning events; the actual pruning of a printer is always logged.
Note: This setting is used only on domain controllers.
Spécifie si les événements doivent être enregistrés lorsque le service de nettoyage d’un contrôleur de domaine tente de contacter un ordinateur avant de nettoyer les imprimantes de l’ordinateur.
Le service de nettoyage contacte périodiquement les ordinateurs qui ont publié des imprimantes pour vérifier que ces imprimantes sont toujours disponibles. Si un ordinateur ne répond pas à la tentative de contact, la tentative est répétée le nombre de fois spécifié, à un intervalle spécifié. Le paramètre « Tentative de nettoyage d’Active Directory » détermine le nombre de nouvelles tentatives autorisé ; la valeur par défaut est deux nouvelles tentatives. Le paramètre « Intervalle de nettoyage d’Active Directory » détermine la durée de l’intervalle entre deux nouvelles tentatives ; la valeur par défaut est huit heures. Si l’ordinateur n’a pas répondu à la dernière tentative de contact, ses imprimantes sont nettoyées dans Active Directory.
Si vous activez ce paramètre de stratégie, les événements de contact sont enregistrés dans le journal des événements.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les événements de contact ne sont pas enregistrés dans le journal des événements.
Remarque : ce paramètre n’a aucune incidence sur la journalisation des événements de nettoyage ; le nettoyage d’une imprimante est toujours enregistré dans le journal.
Remarque : ce paramètre n’est utilisé que sur les contrôleurs de domaine.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers- Value name
PruningRetryLog
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: Printing2/PruningRetryLog
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PruningRetryLog' -Value 1 -Type DWordDisable
# Disable: Printing2/PruningRetryLog
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PruningRetryLog' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Printing2/PruningRetryLog
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
Remove-ItemProperty -Path $k -Name 'PruningRetryLog' -ErrorAction SilentlyContinue