Open in the explorer

Set user home folder

Définir le dossier de base de l’utilisateur

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › User Profiles FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Profils utilisateur
Supported on
At least Windows Server 2012, Windows 8 or Windows RT FR: Au minimum Windows Server 2012, Windows 8 ou Windows RT
ADMX file
UserProfiles.admx
Internal name
UserProfiles/USER_HOME

Explanation

This policy setting allows you to specify the location and root (file share or local path) of a user's home folder for a logon session.

If you enable this policy setting, the user's home folder is configured to the specified local or network location, creating a new folder for each user name.

To use this policy setting, in the Location list, choose the location for the home folder. If you choose “On the network,” enter the path to a file share in the Path box (for example, \\ComputerName\ShareName), and then choose the drive letter to assign to the file share. If you choose “On the local computer,” enter a local path (for example, C:\HomeFolder) in the Path box.

Do not specify environment variables or ellipses in the path. Also, do not specify a placeholder for the user name because the user name will be appended at logon.

Note: The Drive letter box is ignored if you choose “On the local computer” from the Location list. If you choose “On the local computer” and enter a file share, the user's home folder will be placed in the network location without mapping the file share to a drive letter.

If you disable or do not configure this policy setting, the user's home folder is configured as specified in the user's Active Directory Domain Services account.

If the "Set Remote Desktop Services User Home Directory" policy setting is enabled, the “Set user home folder” policy setting has no effect.

French text from Windows 11 26H2

Ce paramètre de stratégie vous permet de spécifier l’emplacement et la racine (partage de fichiers ou chemin d’accès local) du dossier de base d’un utilisateur pour une session ouverte.

Si vous activez ce paramètre de stratégie, le dossier de base de l’utilisateur est l’emplacement local ou réseau spécifié, ce qui crée un nouveau dossier pour chaque nom d’utilisateur.

Pour utiliser ce paramètre de stratégie, dans la liste Emplacement, choisissez l’emplacement du dossier de base. Si vous choisissez « Sur le réseau », entrez le chemin d’accès à un partage de fichiers dans la zone Chemin d’accès (par exemple, \\nom_ordinateur\nom_partage), puis choisissez la lettre de lecteur à assigner au partage de fichiers Si vous choisissez « Sur l’ordinateur local », entrez un chemin d’accès local (par exemple, C:\dossier_de_base) dans la zone Chemin d’accès.

Ne spécifiez pas de variables d’environnement ou d’ellipses dans le chemin d’accès. Ne spécifiez pas non plus d’emplacement réservé pour le nom d’utilisateur, car celui-ci sera ajouté lors de l’ouverture de session.

Remarque : la zone Lettre de lecteur est ignorée si vous choisissez « Sur l’ordinateur local » dans la liste Emplacement. Si vous choisissez « Sur l’ordinateur local » et entrez un partage de fichiers, le dossier de base de l’utilisateur est placé à l’emplacement réseau sans mappage du partage de fichiers à une lettre de lecteur.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, le dossier de base de l’utilisateur est configuré tel que spécifié dans le compte des Services de domaine Active Directory de l’utilisateur.

Si le paramètre de stratégie « Définir le répertoire de base de l’utilisateur des services Bureau à distance » est activé, le paramètre de stratégie « Définir le dossier de base de l’utilisateur » n’a aucun effet.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System
Value name
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

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: UserProfiles/USER_HOME
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Location
# Possible options:
#   On the network = 1
#   On the local computer = 0
Set-ItemProperty -Path $k -Name 'HomeDirLocation' -Value 1 -Type DWord
# Path
Set-ItemProperty -Path $k -Name 'HomeDir' -Value '<value>' -Type String
# Drive letter
# Possible options:
#   G: = G:; H: = H:; I: = I:; J: = J:; K: = K:; L: = L:; M: = M:; N: = N:; O: = O:; P: = P:
#   Q: = Q:; R: = R:; S: = S:; T: = T:; U: = U:; V: = V:; W: = W:; X: = X:; Y: = Y:; Z: = Z:
Set-ItemProperty -Path $k -Name 'HomeDirDrive' -Value 'Z:' -Type String

Disable

# Disable: UserProfiles/USER_HOME
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": UserProfiles/USER_HOME
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
Remove-ItemProperty -Path $k -Name 'HomeDirLocation' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'HomeDir' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'HomeDirDrive' -ErrorAction SilentlyContinue

Options (3)

LabelControlRegistry valueREG typeConstraints / details
Location:Emplacement :USER_HOME_LOCATIONDrop-down listenumHomeDirLocationREG_DWORD
LabelValue
On the networkREG_DWORD = 1
On the local computerREG_DWORD = 0
Path:Chemin d’accès :HOME_PATHText boxtextHomeDirREG_SZ
Required
Drive letterLettre de lecteurDRIVE_LETTERDrop-down listenumHomeDirDriveREG_SZ
Default choice (UI): #19
LabelValue
G:REG_SZ = G:
H:REG_SZ = H:
I:REG_SZ = I:
J:REG_SZ = J:
K:REG_SZ = K:
L:REG_SZ = L:
M:REG_SZ = M:
N:REG_SZ = N:
O:REG_SZ = O:
P:REG_SZ = P:
Q:REG_SZ = Q:
R:REG_SZ = R:
S:REG_SZ = S:
T:REG_SZ = T:
U:REG_SZ = U:
V:REG_SZ = V:
W:REG_SZ = W:
X:REG_SZ = X:
Y:REG_SZ = Y:
Z:REG_SZ = Z:

Availability