Limit the size of the entire roaming user profile cache
Limiter la taille de l’ensemble du cache des profils utilisateur itinérant
Explanation
This policy setting allows you to limit the size of the entire roaming user profile cache on the local drive. This policy setting only applies to a computer on which the Remote Desktop Session Host role service is installed.
Note: If you want to limit the size of an individual user profile, use the "Limit profile size" policy setting located in User Configuration\Policies\Administrative Templates\System\User Profiles.
If you enable this policy setting, you must specify a monitoring interval (in minutes) and a maximum size (in gigabytes) for the entire roaming user profile cache. The monitoring interval determines how often the size of the entire roaming user profile cache is checked. When the size of the entire roaming user profile cache exceeds the maximum size that you have specified, the oldest (least recently used) roaming user profiles will be deleted until the size of the entire roaming user profile cache is less than the maximum size specified.
If you disable or do not configure this policy setting, no restriction is placed on the size of the entire roaming user profile cache on the local drive.
Note: This policy setting is ignored if the "Prevent Roaming Profile changes from propagating to the server" policy setting located in Computer Configuration\Policies\Administrative Templates\System\User Profiles is enabled.
Ce paramètre de stratégie permet de limiter la taille de l'intégralité du cache des profils utilisateur itinérant sur le disque local. Ce paramètre de stratégie s'applique uniquement à un ordinateur sur lequel le service du rôle Hôte de la session Bureau à distance est installé.
Remarque : si vous avez l'intention de limiter la taille d'un profil utilisateur individuel, utilisez le paramètre de stratégie « Limiter la taille du profil » sous Configuration utilisateur\Stratégies\Modèles d'administration\Système\Profils utilisateur.
Si vous activez ce paramètre de stratégie, vous devez spécifier un intervalle d'analyse (en minutes) et une taille maximale (en giga-octets) pour l'ensemble du cache du profil utilisateur itinérant. L'intervalle d'analyse détermine la fréquence à laquelle la taille de l'ensemble du cache du profil utilisateur itinérant est vérifiée. Lorsque la taille de l'ensemble du cache du profil utilisateur itinérant dépasse le seuil maximum prévu, les profils utilisateur itinérant plus anciens (c'est-à-dire ceux utilisés le moins récemment) sont supprimés jusqu'à ce que la taille du cache soit inférieure à la limite maximale spécifiée.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, aucune restriction ne s'applique à la taille de l'intégralité du cache des profils utilisateur itinérant sur le disque local.
Remarque : ce paramètre de stratégie n'est pas pris en compte en cas d'activation du paramètre de stratégie « Empêcher la propagation des modifications de profils itinérants vers le serveur » dans Configuration ordinateur\Stratégies\Modèles d'administration\Système\Profils utilisateur.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services- Value name
DeleteRoamingUserProfile
| 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: TerminalServer/TS_DELETE_ROAMING_USER_PROFILES
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DeleteRoamingUserProfile' -Value 1 -Type DWord
# Monitoring interval (minutes)
Set-ItemProperty -Path $k -Name 'MonitoringInterval' -Value 900 -Type DWord # between 15 and 10080
# Maximum cache size (GBs)
Set-ItemProperty -Path $k -Name 'ProfileDirectoryQuota' -Value 600 -Type DWord # between 5 and 10000Disable
# Disable: TerminalServer/TS_DELETE_ROAMING_USER_PROFILES
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DeleteRoamingUserProfile' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": TerminalServer/TS_DELETE_ROAMING_USER_PROFILES
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'DeleteRoamingUserProfile' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MonitoringInterval' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ProfileDirectoryQuota' -ErrorAction SilentlyContinueOptions (2)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Monitoring interval (minutes):Intervalle d'analyse (minutes) :TS_PROFILE_DIRECTORY_MONITORING_INTERVAL | Numeric boxdecimal | MonitoringInterval | REG_DWORD | Required · Min: 15 · Max: 10080 · Default (UI): 900 |
| Maximum cache size (GBs):Taille maximale du cache (Go) :TS_PROFILE_DIRECTORY_QUOTA | Numeric boxdecimal | ProfileDirectoryQuota | REG_DWORD | Required · Min: 5 · Max: 10000 · Default (UI): 600 |