Set Remote Desktop Services User Home Directory
Verified with Windows 11 25H2 — updated on July 30, 2026
Supported on: At least Windows Server 2003
Path in the GPO console
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Profiles Description
Specifies whether Remote Desktop Services uses the specified network share or local directory path as the root of the user's home directory for a Remote Desktop Services session. To use this setting, select the location for the home directory (network or local) from the Location drop-down list. If you choose to place the directory on a network share, type the Home Dir Root Path in the form \\Computername\Sharename, and then select the drive letter to which you want the network share to be mapped. If you choose to keep the home directory on the local computer, type the Home Dir Root Path in the form "Drive:\Path" (without quotes), without environment variables or ellipses. Do not specify a placeholder for user alias, because Remote Desktop Services automatically appends this at logon. Note: The Drive Letter field is ignored if you choose to specify a local path. If you choose to specify a local path but then type the name of a network share in Home Dir Root Path, Remote Desktop Services places user home directories in the network location. If the status is set to Enabled, Remote Desktop Services creates the user's home directory in the specified location on the local computer or the network. The home directory path for each user is the specified Home Dir Root Path and the user's alias. If the status is set to Disabled or Not Configured, the user's home directory is as specified at the server.
Registry
SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services MDM / Intune (CSP)
./Device/Vendor/MSFT/Policy/Config/ADMX_TerminalServer/TS_USER_HOME Microsoft Learn documentation Mapping data: Microsoft Learn (CC BY 4.0)
Export Builder
BETAConfigure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.
These exports write the registry — this is not a managed GPO. ⓘ
.reg file
Windows Registry Editor Version 5.00
; Exported from gporais.com
; Policy: Set Remote Desktop Services User Home Directory
; State: Enabled
; Supported on: At least Windows Server 2003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"WFHomeDirUNC"=dword:00000001
"WFHomeDir"=""
"WFHomeDirDrive"="Z:" More formats (PowerShell, Intune, SCCM)
PowerShell
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'WFHomeDirUNC' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'WFHomeDir' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'WFHomeDirDrive' -Value 'Z:' -Type String Intune XML
OMA-URI: ./Device/Vendor/MSFT/Policy/Config/ADMX_TerminalServer/TS_USER_HOME
Data type: String
Value:
<enabled/>
<data id="TS_USER_HOME_LOCATION" value="1"/>
<data id="TS_HOME_DIR" value=""/>
<data id="TS_DRIVE_LETTER" value="Z:"/> Intune Remediation
# === Detection script ===
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDirUNC' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDir' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDirDrive' -Expected 'Z:' -Kind String)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'WFHomeDirUNC' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'WFHomeDir' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'WFHomeDirDrive' -Value 'Z:' -Type String SCCM scripts
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
# SCCM Configuration Item guidance:
# Create a Configuration Item of type "Setting: Script".
# Discovery script: use the Detection script below.
# Remediation script: use the Remediation script below.
# Compliance rule: the Discovery script output equals 'Compliant'.
# === Detection script ===
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDirUNC' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDir' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'WFHomeDirDrive' -Expected 'Z:' -Kind String)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Set Remote Desktop Services User Home Directory
# State: Enabled
# Supported on: At least Windows Server 2003
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'WFHomeDirUNC' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'WFHomeDir' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'WFHomeDirDrive' -Value 'Z:' -Type String Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.