Empêcher l’ajout automatique de dossiers partagés à l’index Windows Search
Prevent automatically adding shared folders to the Windows Search index
Explication
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
| État | Valeur é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 DWordDé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 DWordRevenir à « Non configuré »
# Revenir à « Non configuré » : Search/AutoIndexSharedFolders
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
Remove-ItemProperty -Path $k -Name 'AutoIndexSharedFolders' -ErrorAction SilentlyContinue