Open in the explorer

Prevent Media Sharing

Empêcher le partage de médias

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Windows Media Player FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Lecteur Windows Media
Supported on
Windows Media Player 11 for Windows XP or Windows Media Player 11 for Windows Vista or later. FR: Lecteur Windows Media 11 pour Windows XP ou Lecteur Windows Media 11 pour Windows Vista ou version ultérieure.
ADMX file
windowsmediaplayer.admx
Internal name
windowsmediaplayer/PreventLibrarySharing

Explanation

This policy setting allows you to prevent media sharing from Windows Media Player.

If you enable this policy setting, any user on this computer is prevented from sharing digital media content from Windows Media Player with other computers and devices that are on the same network. Media sharing is disabled from Windows Media Player or from programs that depend on the Player's media sharing feature.

If you disable or do not configure this policy setting, anyone using Windows Media Player can turn media sharing on or off.

French text from Windows 11 26H2

Ce paramètre de stratégie permet d’empêcher le partage de médias depuis le Lecteur Windows Media.

Si vous activez ce paramètre de stratégie, aucun utilisateur de l’ordinateur ne peut partager le contenu multimédia numérique du Lecteur Windows Media avec d’autres ordinateurs ou périphériques du même réseau. Le partage de médias est désactivé depuis le Lecteur Windows Media ou depuis des programmes qui dépendent de la fonctionnalité de partage de médias du Lecteur.

Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, quiconque utilise le Lecteur Windows Media peut activer ou désactiver le partage de médias.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsMediaPlayer
Value name
PreventLibrarySharing
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

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: windowsmediaplayer/PreventLibrarySharing
$k = 'HKLM:\Software\Policies\Microsoft\WindowsMediaPlayer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PreventLibrarySharing' -Value 1 -Type DWord

Disable

# Disable: windowsmediaplayer/PreventLibrarySharing
$k = 'HKLM:\Software\Policies\Microsoft\WindowsMediaPlayer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PreventLibrarySharing' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": windowsmediaplayer/PreventLibrarySharing
$k = 'HKLM:\Software\Policies\Microsoft\WindowsMediaPlayer'
Remove-ItemProperty -Path $k -Name 'PreventLibrarySharing' -ErrorAction SilentlyContinue

Availability