In enterprise Remote Desktop Services (RDS) server farms hosting multi-user environments for Pakistani software houses, call centers, and accounting firms, user profile management represents one of the most critical operational challenges. When users connect across multiple RD Session Hosts (RDSH), their personalized desktop settings, application configurations, browser data, and local files must roam seamlessly without inducing sluggish logon delays or consuming excessive network bandwidth.[1]
For over a decade, Microsoft User Profile Disks (UPD) served as the standard native mechanism to roam user states by mounting dedicated virtual hard disks (UVHD-<SID>.vhdx) across network shares. However, modern workplace tools—specifically Microsoft 365 Outlook Cached Exchange Mode, Microsoft Teams, and OneDrive—frequently malfunction on UPD, while ungraceful session disconnects trigger frustrating "You have been logged on with a temporary profile" errors due to lingering SMB file locks. This comprehensive guide details the internal mechanics of UPD, provides production-tested troubleshooting runbooks for VHDX lock contention, and delivers a step-by-step PowerShell migration roadmap to transition legacy UPD deployments to modern FSLogix Profile Containers on Windows Server 2019, 2022, and 2025.
1. Architectural Comparison: User Profile Disks (UPD) vs. FSLogix
Understanding the fundamental structural differences between UPD and FSLogix is essential for systems administrators planning high-concurrency infrastructure:[2]
| Architecture Feature | Legacy User Profile Disks (UPD) | Modern FSLogix Profile Containers |
|---|---|---|
| Introduction / Platform | Windows Server 2012 / 2012 R2 | Acquired by Microsoft (Windows Server 2016+) |
| VHDX File Naming | Opaque Security Identifier: UVHD-<SID>.vhdx |
Human-readable: Profile_%username%_%sid%.vhdx |
| Mount Mechanism | Native RDS session hook (rdpdr.exe / VFS) |
File system filter driver (frxdrv.sys) |
| Outlook Caching (OST) | Broken / Non-roaming (Index corruptions) | Native full support via Windows Search database roaming |
| OneDrive Sync Client | Completely unsupported | Fully supported on multi-session Windows Server |
| Concurrent Multi-Session | Strictly single-session (Exclusive read/write lock) | Supported (Read-only multi-session or VHDX merging) |
| Disconnection Handling | Prone to orphaned SMB lock states | Automated lease release and timeout recovery |
| Storage Resilience | Single SMB UNC path | Cloud Cache (Local NVMe cache + redundant remote shares) |
While UPD treated the entire profile as a single opaque block container, FSLogix operates at the file system filter level, intercepting I/O requests before they reach the disk. This enables FSLogix to redirect user profile folders transparently without Windows realizing the directory resides on a remote network share.[3]
2. Technical Anatomy of User Profile Disks (UPD)
When UPD is enabled on an RDS Session Collection, the RD Connection Broker orchestrates profile provisioning across a centralized Server Message Block (SMB) network share:
The Disk Provisioning Lifecycle
- Template Creation: When UPD is first configured, the server creates a baseline template disk named
UVHD-template.vhdxon the storage share (e.g.,\\storage.local\profiles$). - User Logon Initialization: When a user logs in for the first time, the RDSH host copies
UVHD-template.vhdxto create a dedicated user disk named after their Active Directory Security Identifier:UVHD-S-1-5-21-394829102-192837482-1049281-1105.vhdx. - Volume Mounting: The operating system issues a loopback VHDX mount over the SMB share, attaching the virtual disk to a dynamically generated junction point under
C:\Users\<username>. - Logoff Dismount: Upon user logoff, the filesystem flushes dirty buffers, dismounts the VHDX, and releases the SMB file handle back to the file server.
Configuring UPD via PowerShell
Administrators can inspect and manage UPD settings programmatically on the RD Connection Broker:
# Enable and configure User Profile Disks on a Session Collection
Set-RDSessionCollectionConfiguration -CollectionName "Finance-RDS" `
-EnableUserProfileDisk `
-MaxUserProfileDiskSizeGB 30 `
-DiskPath "\\storage.local\profiles$" `
-IncludeExistingUserFoldersAndFiles `
-ConnectionBroker "broker.yourdomain.com.pk"
# Query active UPD configuration
Get-RDSessionCollectionConfiguration -CollectionName "Finance-RDS" -UserProfileDisk
3. Resolving the “Temporary Profile” & VHDX SMB Lock Contention
The single greatest operational headache with UPD in production is the temporary profile loop. If an employee’s remote session is terminated abruptly—due to a network dropout, power outage, or client crash—the file server hosting the profiles share retains an active SMB session lock on UVHD-<SID>.vhdx.[4]
When the user attempts to reconnect, the RD Connection Broker routes them to an available RDSH host. That host attempts to acquire an exclusive lock on the VHDX file, which fails because the previous host still holds the SMB file lock. Consequently, Windows generates a fallback temporary profile (C:\Users\TEMP), stripping the user of all custom desktop shortcuts, Outlook profiles, and local ERP settings.
Diagnostic Runbook: Unlocking Orphaned UPD Disks
Execute the following PowerShell commands on the central storage file server to identify and release orphaned file locks:
# 1. Resolve the user's AD username to their Security Identifier (SID)
$userName = "bilal.ahmed"
$userSID = (Get-ADUser -Identity $userName).SID.Value
Write-Host "Target User SID: $userSID" -ForegroundColor Cyan
# 2. Locate active SMB open file handles for the user's VHDX
$openFiles = Get-SmbOpenFile | Where-Object { $_.Path -like "*$userSID*" }
If ($openFiles) {
ForEach ($file in $openFiles) {
Write-Host "Found locked VHDX file on Host: $($file.ClientComputerName)" -ForegroundColor Yellow
Write-Host "File ID: $($file.FileId) | Path: $($file.Path)"
# 3. Forcibly close the stale SMB handle
Close-SmbOpenFile -FileId $file.FileId -Force
Write-Host "Successfully closed SMB handle for $userName." -ForegroundColor Green
}
} Else {
Write-Host "No active SMB locks detected on file server for $userSID." -ForegroundColor White
}
Clearing Residual Profile Registry Keys on RDSH Hosts
When Windows logs a user in with a temporary profile, it creates an orphaned backup registry key with a .bak extension. This prevents future successful logons even after the VHDX file lock is cleared:
# Execute on the affected RD Session Host
$profileList = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
Get-ChildItem -Path $profileList | ForEach-Object {
$keyPath = $_.PSPath
If ($_.PSChildName -like "$userSID.bak") {
Write-Host "Detected corrupted backup profile key: $($_.PSChildName)" -ForegroundColor Red
# Remove the stale .bak profile key
Remove-Item -Path $keyPath -Force -Recurse
Write-Host "Corrupted registry key removed successfully." -ForegroundColor Green
}
}
4. Storage Share Security: NTFS and SMB Permissions
Misconfigured NTFS permissions on profile shares represent a frequent vector for privilege escalation and profile corruption. Follow the strict least-privilege matrix:
1. SMB Share Permissions (\\storage.local\profiles$)
Authenticated Users -> Full Control
Domain Admins -> Full Control
2. NTFS File System Permissions
Apply the following advanced security permissions to the root directory hosting the profiles:
| Security Principal | Applies To | Permitted Rights |
|---|---|---|
| CREATOR OWNER | Subfolders and files only | Full Control |
| RDS Session Hosts Group | This folder, subfolders, and files | Full Control |
| Domain Admins | This folder, subfolders, and files | Full Control |
| Domain Users | This folder only | Create Folders / Append Data, Read & Execute |
| SYSTEM | This folder, subfolders, and files | Full Control |
5. End-to-End Migration Guide: UPD to FSLogix Profile Containers
Because Microsoft has deprecated User Profile Disks in favor of FSLogix, migrating existing environments is critical for ensuring full compatibility with Windows Server 2022/2025 and Microsoft 365.
Step 1: Install FSLogix on all RD Session Hosts
Download and install the official FSLogix Apps release from Microsoft:
# Extract and install FSLogix silently
Start-Process -FilePath "FSLogixAppsSetup.exe" -ArgumentList "/install /quiet" -Wait
# Verify the FSLogix filter driver service is running
Get-Service -Name "frxdrv"
Step 2: Automated PowerShell Migration Script
The following production script iterates through legacy UVHD-<SID>.vhdx disks, resolves the user’s Active Directory username, mounts both the source UPD and a freshly created FSLogix container, and copies all profile data while preserving NTFS Access Control Lists (ACLs):[5]
<#
.SYNOPSIS
Migrates User Profile Disks (UPD) to FSLogix Profile Containers.
.DESCRIPTION
Mounts UVHD-<SID>.vhdx, provisions target FSLogix VHDX, and executes
robocopy with full metadata preservation.
#>
Param(
[Parameter(Mandatory=$true)]
[string]$UpdSharePath, # e.g. "\\storage.local\profiles$"
[Parameter(Mandatory=$true)]
[string]$FslogixSharePath # e.g. "\\storage.local\fslogix$"
)
Import-Module Hyper-V -ErrorAction SilentlyContinue
Import-Module ActiveDirectory
$updFiles = Get-ChildItem -Path $UpdSharePath -Filter "UVHD-S-1-5-*.vhdx"
ForEach ($file in $updFiles) {
# Extract SID from filename
$sid = ($file.BaseName -replace "UVHD-", "")
Try {
$adUser = Get-ADUser -Identity $sid -ErrorAction Stop
$samAccountName = $adUser.SamAccountName
Write-Host "Processing User: $samAccountName ($sid)..." -ForegroundColor Cyan
} Catch {
Write-Host "Skipping orphaned disk with unknown SID: $sid" -ForegroundColor Yellow
Continue
}
# Define target FSLogix directory and VHDX path
$targetUserDir = Join-Path $FslogixSharePath "${samAccountName}_$sid"
If (!(Test-Path $targetUserDir)) { New-Item -ItemType Directory -Path $targetUserDir -Force | Out-Null }
$targetVhdx = Join-Path $targetUserDir "Profile_$samAccountName.vhdx"
# Mount source UPD
$updMount = Mount-VHD -Path $file.FullName -PassThru | Get-Disk | Get-Partition | Get-Volume
$updDrive = "$($updMount.DriveLetter):\"
# Create and initialize target FSLogix dynamic VHDX (30GB capacity)
$fslogixVhd = New-VHD -Path $targetVhdx -SizeBytes 30GB -Dynamic
$fslogixMount = Mount-VHD -Path $targetVhdx -PassThru | Initialize-Disk -PartitionStyle GPT -PassThru |
New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Profile-$samAccountName"
$fslogixDrive = "$($fslogixMount.DriveLetter):\"
Write-Host "Copying profile data via Robocopy..." -ForegroundColor White
robocopy $updDrive $fslogixDrive /E /COPYALL /XJ /R:1 /W:1 /MT:8 | Out-Null
# Dismount both virtual disks
Dismount-VHD -Path $file.FullName
Dismount-VHD -Path $targetVhdx
Write-Host "Successfully migrated $samAccountName to FSLogix!" -ForegroundColor Green
}
Step 3: Configure FSLogix Group Policy Settings
Disable UPD on the Session Collection, then configure FSLogix via GPO under:
Computer Configuration
└── Administrative Templates
└── FSLogix
└── Profile Containers
- Enabled: Set to
Enabled. - VHD Locations: Set to
\\storage.local\fslogix$. - Size in MBs: Set to
30720(30 GB). - Volume Type: Set to
VHDX.
6. Enterprise Bare-Metal Storage Architecture in Pakistan
In multi-user RDS farms hosting dozens of concurrent virtual desktop sessions, profile disks generate intense, concurrent random 4K read/write I/O bursts during morning logon storms (8:00 AM – 9:30 AM). In shared cloud VPS setups, storage throttling on shared SAN arrays causes severe disk queue latency spikes, leading to logon timeouts and frozen taskbars.
- Dedicated Bare-Metal Compute & Storage: Hosting your RDS Session Hosts and central SMB profile shares on physical Dedicated Servers ensures unshared PCIe Gen 4 NVMe storage pools, dedicated high-capacity ECC RAM, and non-blocking 10Gbps local network uplinks capable of handling thousands of concurrent VHDX IOPS without latency penalties.
- Domestic Low-Latency Data Centers in Pakistan: For corporate enterprises, software houses, and financial institutions operating across Karachi, Lahore, and Islamabad, deploying on Dedicated Servers in Pakistan delivers sub-10ms domestic ping over direct Pakistan Internet Exchange (PKIX) fiber loops. Keeping profile storage local within Tier-3 Karachi and Lahore data centers guarantees blazing-fast logon times and airtight regulatory compliance with SBP and SECP data residency mandates.
Deploy Ultra-Fast RDS Profile Storage on Dedicated Servers in Pakistan
Eliminate temporary profile errors, VHDX file locks, and slow logon times. Deploy dedicated Windows Server hosts featuring enterprise PCIe 4.0 NVMe storage, dedicated hardware resources, unmetered domestic bandwidth, and customized RDS licensing across Tier-3 Karachi and Lahore facilities.
Sources & Official References
- Microsoft Learn. (2024). Manage User Profile Disks in Remote Desktop Services (Windows Server 2012 R2 through 2025). Microsoft Technical Documentation. https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-user-profile-disks
- Microsoft Learn. (2023). FSLogix Overview and Profile Containers Architecture. Microsoft Technical Documentation. https://learn.microsoft.com/en-us/fslogix/overview
- Microsoft Support. (2023). Troubleshooting Temporary Profiles in Remote Desktop Services and VHDX Lock Removal. Microsoft Support Knowledgebase. https://learn.microsoft.com/en-us/troubleshoot/windows-server/remote/troubleshoot-user-profile-service-error
- Microsoft Learn. (2024). Storage Permissions and SMB Configuration for FSLogix and User Profile Disks. Microsoft Architecture Center. https://learn.microsoft.com/en-us/fslogix/configure-storage-permissions-ht
- Microsoft Tech Community. (2023). Migrating from User Profile Disks to FSLogix Profile Containers: Scripts and Best Practices. Microsoft Virtual Desktop Blog. https://techcommunity.microsoft.com/t5/azure-virtual-desktop/migrating-from-user-profile-disks-upd-to-fslogix/m-p/1183204
Disclaimer: This post is for informational and educational purposes only, accurate to the best of our knowledge at publication. It does not constitute advice. We do not guarantee accuracy or completeness and accept no liability for any decisions or losses resulting from reliance on this content.
