Ouvrir dans l'explorateur

Empêcher l’ajout automatique de dossiers partagés à l’index Windows Search

Prevent automatically adding shared folders to the Windows Search index

Type
Ordinateur
Chemin GPO
Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Rechercher EN : Computer Configuration › Policies › Administrative Templates › Windows Components › Search
Pris en charge sur
Toute version de Microsoft Windows avec Windows Search 4.0 EN : Any version of Microsoft Windows with Windows Search 4.0
Fichier ADMX
Search.admx
Nom interne
Search/AutoIndexSharedFolders

Explication

Texte français issu de Windows 11 26H2

Ce paramètre de stratégie configure la façon dont Windows Search ajoute des dossiers partagés à l’index de recherche.

Si vous activez ce paramètre de stratégie, Windows Search ne peut pas ajouter automatiquement des dossiers partagés à l’index. Windows Search n’ajoute pas automatiquement les partages créés sur l’ordinateur à l’étendue de l’index.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, Windows Search surveille les dossiers partagés ou non partagés sur cet ordinateur et les ajoute automatiquement à l’index ou les supprime de ce dernier.

This policy setting configures how Windows Search adds shared folders to the search index.

If you enable this policy setting, Windows Search is prevented from automatically adding shared folders to the index. Windows Search does not automatically add shares created on the computer to the scope of the index.

If you disable or do not configure this policy setting, Windows Search monitors which folders are shared or not shared on this computer, and automatically adds them to or removes them from the index.

Registre

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search
Nom de la valeur
AutoIndexSharedFolders
ÉtatValeur écrite
ActivéREG_DWORD = 1
DésactivéREG_DWORD = 0

PowerShell

Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.

Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.

Activer

# Activer : Search/AutoIndexSharedFolders
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutoIndexSharedFolders' -Value 1 -Type DWord

Désactiver

# Désactiver : Search/AutoIndexSharedFolders
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutoIndexSharedFolders' -Value 0 -Type DWord

Revenir à « Non configuré »

# Revenir à « Non configuré » : Search/AutoIndexSharedFolders
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
Remove-ItemProperty -Path $k -Name 'AutoIndexSharedFolders' -ErrorAction SilentlyContinue

Disponibilité