Prevent users' app data from being stored on non-system volumes
Empêcher le stockage des données d'applications des utilisateurs sur des volumes non-système
Explanation
Prevent users' app data from moving to another location when an app is moved or installed on another location.
If you enable this setting, all users' app data will stay on the system volume, regardless of where the app is installed.
If you disable or do not configure this setting, then when an app is moved to a different volume, the users' app data will also move to this volume.
Empêcher le déplacement des données d'applications des utilisateurs vers un autre emplacement lors du déplacement ou de l'installation d'une application à un autre emplacement.
Si vous activez ce paramètre, toutes les données d'applications des utilisateurs seront conservées sur le volume système, quel que soit l'emplacement d'installation de l'application.
Si vous désactivez ou ne configurez pas ce paramètre, lorsqu'une application est déplacée vers un autre volume, les données d'applications des utilisateurs sont également déplacées vers ce volume.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Appx- Value name
RestrictAppDataToSystemVolume
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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: AppxPackageManager/RestrictAppDataToSystemVolume
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Appx'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'RestrictAppDataToSystemVolume' -Value 1 -Type DWordDisable
# Disable: AppxPackageManager/RestrictAppDataToSystemVolume
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Appx'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'RestrictAppDataToSystemVolume' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": AppxPackageManager/RestrictAppDataToSystemVolume
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Appx'
Remove-ItemProperty -Path $k -Name 'RestrictAppDataToSystemVolume' -ErrorAction SilentlyContinue