Ouvrir dans l'explorateur

Empêcher les utilisateurs de partager des fichiers de leur profil

Prevent users from sharing files within their profile.

Type
Utilisateur
Chemin GPO
Configuration utilisateur › Stratégies › Modèles d'administration › Composants Windows › Partage réseau EN : User Configuration › Policies › Administrative Templates › Windows Components › Network Sharing
Pris en charge sur
Au minimum Windows Vista EN : At least Windows Vista
Fichier ADMX
Sharing.admx
Nom interne
Sharing/NoInplaceSharing

Explication

Texte français issu de Windows 11 26H2

Ce paramètre de stratégie indique si les utilisateurs peuvent partager des fichiers de leur profil. Par défaut, les utilisateurs sont autorisés à partager des fichiers de leur profil avec d’autres utilisateurs du réseau, une fois qu’un administrateur a donné son consentement pour l’ordinateur concerné. Un administrateur peut donner son consentement pour un ordinateur via l’Assistant approprié afin de permettre le partage des fichiers du profil d’un utilisateur.

Si vous activez ce paramètre de stratégie, les utilisateurs ne peuvent pas partager les fichiers de leur profil à l’aide de l’Assistant correspondant. Par ailleurs, l’Assistant utilisé ne peut pas créer de partage à l’emplacement %root%\users ; il permet uniquement de créer des partages SMB sur des dossiers.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les utilisateurs peuvent partager des fichiers de leur profil utilisateur lorsqu’un administrateur a donné son consentement pour l’ordinateur concerné.

This policy setting specifies whether users can share files within their profile. By default users are allowed to share files within their profile to other users on their network after an administrator opts in the computer. An administrator can opt in the computer by using the sharing wizard to share a file within their profile.

If you enable this policy setting, users cannot share files within their profile using the sharing wizard. Also, the sharing wizard cannot create a share at %root%\users and can only be used to create SMB shares on folders.

If you disable or don't configure this policy setting, users can share files out of their user profile after an administrator has opted in the computer.

Registre

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Nom de la valeur
NoInplaceSharing
É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 : Sharing/NoInplaceSharing
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoInplaceSharing' -Value 1 -Type DWord

Désactiver

# Désactiver : Sharing/NoInplaceSharing
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoInplaceSharing' -Value 0 -Type DWord

Revenir à « Non configuré »

# Revenir à « Non configuré » : Sharing/NoInplaceSharing
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoInplaceSharing' -ErrorAction SilentlyContinue

Disponibilité