Open in the explorer

Directory pruning interval

Intervalle 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/PruningInterval

Explanation

Specifies how often the pruning service on a domain controller contacts computers to verify that their printers are operational.

The pruning service periodically contacts computers that have published printers. If a computer does not respond to the contact message (optionally, after repeated attempts), 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 repeated contact attempts before deleting printers from Active Directory.

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

If you do not configure or disable this setting the default values will be used.

Note: This setting is used only on domain controllers.

French text from Windows 11 26H2

Spécifie la fréquence à laquelle le service de nettoyage d’un contrôleur de domaine contacte les ordinateurs pour vérifier que leurs imprimantes sont opérationnelles.

Le service de nettoyage contacte périodiquement les ordinateurs qui ont publié des imprimantes. Si un ordinateur ne répond pas au message de contact (éventuellement après plusieurs tentatives), le service de nettoyage « nettoie » (supprime d’Active Directory) 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 tentatives de contact répétées avant de supprimer les imprimantes d’Active Directory.

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

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/PruningInterval
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Interval
# Possible options:
#   Continuous = 0; 10 Minutes = 10; 30 Minutes = 30; 1 Hour = 60; 4 Hours = 240; 8 Hours = 480
#   12 Hours = 720; 1 Day = 1440; 2 Days = 2880; 3 Days = 4320; 4 Days = 5760; 5 Days = 7200
#   6 Days = 8640; 1 Week = 10080; 2 Weeks = 20160; 3 Weeks = 30240; 4 Weeks = 40320
#   5 Weeks = 50400; 6 Weeks = 60480; 7 Weeks = 70560; Infinite = 4294967295
Set-ItemProperty -Path $k -Name 'PruningInterval' -Value 480 -Type DWord

Disable

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

Revert to "Not configured"

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

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Interval:Intervalle :PruningIntervalTitleDrop-down listenumPruningIntervalREG_DWORD
Default choice (UI): #5
LabelValue
ContinuousREG_DWORD = 0
10 MinutesREG_DWORD = 10
30 MinutesREG_DWORD = 30
1 HourREG_DWORD = 60
4 HoursREG_DWORD = 240
8 HoursREG_DWORD = 480
12 HoursREG_DWORD = 720
1 DayREG_DWORD = 1440
2 DaysREG_DWORD = 2880
3 DaysREG_DWORD = 4320
4 DaysREG_DWORD = 5760
5 DaysREG_DWORD = 7200
6 DaysREG_DWORD = 8640
1 WeekREG_DWORD = 10080
2 WeeksREG_DWORD = 20160
3 WeeksREG_DWORD = 30240
4 WeeksREG_DWORD = 40320
5 WeeksREG_DWORD = 50400
6 WeeksREG_DWORD = 60480
7 WeeksREG_DWORD = 70560
InfiniteREG_DWORD = 4294967295

Availability