Ouvrir dans l'explorateur

Autoriser le mappage des dossiers dans Bac à sable Windows

Allow mapping folders into Windows Sandbox

Type
Ordinateur
Chemin GPO
Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Bac à sable Windows EN : Computer Configuration › Policies › Administrative Templates › Windows Components › Windows Sandbox
Pris en charge sur
Au moins Windows 11 Professionnel, Enterprise ou Education avec Bac à sable Windows EN : At least Windows 11 Pro, Enterprise, or Education with Windows Sandbox
Fichier ADMX
WindowsSandbox.admx
Nom interne
WindowsSandbox/AllowMappedFolders

Explication

Texte français issu de Windows 11 26H2

Ce paramètre de stratégie active ou désactive le mappage des dossiers dans le bac à sable.

Si vous activez ce paramètre de stratégie, le mappage des dossiers de l’hôte dans le bac à sable est autorisé.

Si vous activez ce paramètre de stratégie et désactivez l’écriture dans les dossiers mappés, le mappage des dossiers de l’hôte dans le bac à sable sera autorisé, mais sandbox aura uniquement l’autorisation de lire les fichiers.

Si vous désactivez ce paramètre de stratégie, le mappage des dossiers de l’hôte dans le bac à sable ne sera pas autorisé.

Si vous ne configurez pas ce paramètre de stratégie, les dossiers mappés sont activés.

Notez que l’exposition de dossiers de l’hôte dans le conteneur peut avoir des implications en matière de sécurité.

This policy setting enables or disables mapping folders into sandbox.

If you enable this policy setting, mapping folders from the host into Sandbox will be permitted.

If you enable this policy setting and disable write to mapped folders, mapping folders from the host into Sandbox will be permitted, but Sandbox will only have permission to read the files.

If you disable this policy setting, mapping folders from the host into Sandbox will not be permitted.

If you do not configure this policy setting, mapped folders will be enabled.

Note that there may be security implications of exposing folders from the host into the container.

Registre

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox
Nom de la valeur
AllowMappedFolders
É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 : WindowsSandbox/AllowMappedFolders
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Sandbox'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowMappedFolders' -Value 1 -Type DWord
# Autorisez le bac à sable à écrire dans les dossiers mappés.
# décoché : 0
Set-ItemProperty -Path $k -Name 'AllowWriteToMappedFolders' -Value 1 -Type DWord

Désactiver

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

Revenir à « Non configuré »

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

Options (1)

LibelléContrôleValeur de registreType REGContraintes / détails
Autorisez le bac à sable à écrire dans les dossiers mappés.Allow Sandbox to write to mapped folders.CheckBox_AllowWriteToMappedFoldersCase à cocherbooleanAllowWriteToMappedFoldersREG_DWORD
Défaut (interface) : true
Coché : REG_DWORD = 1
Décoché : REG_DWORD = 0

Disponibilité

Windows 11

✓ 26H2✓ 25H2✓ 24H2— 23H2— 22H2— 21H2

Windows 10

— 22H2— 21H2— 21H1— 20H2— 2004— 1909— 1903— 1809— 1803— 1709— 1703— 1607— 1511— 1507

Windows Server

✓ 2025— 2022— 2016