Open in the explorer

Directory pruning retry

Tentative de nettoyage d’Active Directory

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Printers FR: Configuration ordinateur › Stratégies › Modèles d'administration › Imprimantes
Supported on
At least Windows 2000 FR: Au minimum Windows 2000
ADMX file
Printing2.admx
Internal name
Printing2/PruningRetries

Explanation

Specifies how many times the pruning service on a domain controller repeats its attempt 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 message, the message is repeated for the specified number of times. If the computer still fails to respond, then the pruning service "prunes" (deletes from Active Directory) printer objects the computer has published.

By default, the pruning service contacts computers every eight hours and allows two retries before deleting printers from Active Directory. You can use this setting to change the number of retries.

If you enable this setting, you can change the interval between attempts.

If you do not configure or disable this setting, the default values are used.

Note: This setting is used only on domain controllers.

French text from Windows 11 26H2

Spécifie combien de fois le service de nettoyage d’un contrôleur de domaine répète sa tentative d’entrée en contact avec un ordinateur avant de nettoyer ses imprimantes.

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 au message de contact, le message est répété le nombre de fois spécifié. Si l’ordinateur persiste à ne pas répondre, le service de nettoyage « nettoie » (supprime d’Active Directory) alors les objets imprimante que l’ordinateur a publiés.

Par défaut, le service de nettoyage contacte les ordinateurs toutes les huit heures et autorise deux nouvelles tentatives avant de supprimer les imprimantes d’Active Directory. Vous pouvez utiliser ce paramètre pour modifier le nombre de nouvelles tentatives.

Si vous activez ce paramètre, vous pouvez modifier l’intervalle entre les tentatives.

Si vous ne configurez pas ce paramètre ou si vous le désactivez, les valeurs par défaut sont utilisées.

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
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

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/PruningRetries
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Retries
# Possible options:
#   No Retry = 0
#   1 Retry = 1
#   2 Retries = 2
#   3 Retries = 3
#   4 Retries = 4
#   5 Retries = 5
#   6 Retries = 6
Set-ItemProperty -Path $k -Name 'PruningRetries' -Value 2 -Type DWord

Disable

# Disable: Printing2/PruningRetries
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": Printing2/PruningRetries
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
Remove-ItemProperty -Path $k -Name 'PruningRetries' -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Retries:Tentatives :PruningRetriesTitleDrop-down listenumPruningRetriesREG_DWORD
Default choice (UI): #2
LabelValue
No RetryREG_DWORD = 0
1 RetryREG_DWORD = 1
2 RetriesREG_DWORD = 2
3 RetriesREG_DWORD = 3
4 RetriesREG_DWORD = 4
5 RetriesREG_DWORD = 5
6 RetriesREG_DWORD = 6

Availability