Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows Server 2012 R2 / User Profile Disks on Windows Server 2012 R2 / 2016 RDS

October 1, 2018 Windows Server 2012 R2Windows Server 2016

User Profile Disks on Windows Server 2012 R2 / 2016 RDS

User Profile Disks (UPD) is a new feature of Remote Desktop Services in Windows Server 2012. User Profile Disks is an alternative to roaming profiles and folder redirection in the RDS scenarios. The point of UPD is that user and apps data (i. e., a user profile) are stored as a separate VHDX disk on dedicated file on the network shared folder. This virtual disk is mounted to the user session as soon as the user signs in to the RDS server, and unmounted when he logs out (all changes to the user profile are saved to the vhdx disk).

In this article, we’ll describe how to configure and use User Profile Disks on a server with Remote Desktop Services role running on Windows Server 2012 / 2012 R2 / 2016.

Contents:
  • Configuring User Profile Disks on Windows Server RDS
  • UPD: User profile as VHDX file
  • Resizing User Profile Disks Using PowerShell

Configuring User Profile Disks on Windows Server RDS

First of all, it is necessary to create a shared folder on any corporate file server to store user profiles as VHDX disk (if you want to have high availability for UPD disks, you can place UPD files on a clustered file resource). In our example, the path to this folder looks like this: \\rdvh1\DemoLabOficeApp. Servers being a part of RDS collection have to be given full access permission to access this shared folder.

Tip. In a single RDS collection, there can exist only one VHDX profile file for one user. If a user connects to the resources from two different collections, a separate profile disk should be created for each of them.

User Profile Disks mode can be enabled and configured in the collection settings of Remote Desktop Services. This mode can be enabled when creating a new collection, or you can come back to it later.

enable user profile disks

In our example, the collection already exists, so in the Server Manager console, select this collection and in the upper left corner click Tasks -> Edit Properties.

RDS 2012 collection properties

Then in User Profile Disks section check Enable user profile disks, specify the path to the previously created shared folder (\\rdvh1\DemoLabOficeApps) and a maximum profile disk size (let it be 20 GB). Save the changes.

user profile disks path and size limit

After you saved the changes, make sure that NTFS permissions for Profile Disks folder have been changed. In our case, the collection consists of one RDSH01 server, which is granted full control permission.

UPD - NTFS permissions

Full Control permissions has been granted to the RDSH01 server on the shared folder level.

Profile Disks - share permissions

When adding new RD Session Host servers to the RDS collection, the wizard automatically changes the folder permissions and gives access to the new servers. It is very convenient, since when scaling a terminal farm you don’t need to remember to set permissions for the profile folder.

UPD: User profile as VHDX file

Go to the network shared folder with user profiles. A UVHD-template.vhdx file is now being stored here.

UVHD-template.vhdx

This file is the user profile disk template. When a user logs on to the RDS server for the first time, this template is copied and renamed as a VHDX file, containing user SID in its name.

UVHD - user SID

Tip. To match an UPD file name with the user name, you must use a separate script. For example, ShowUPDFolderDetails.ps1 or you can convert the SID to an account name by using the Get-ADUser cmdlet:

Get-ADUser -Identity S-1-5-21-32549751-3956249758-2943215497-23733695

ShowUPDFolderDetails.ps1

Let’s see what a user profile disk contains. To do it, right-click the VHDX file and select Mount. The UPD disk can only be used in one session on one RDS host (exclusive access). You can’t mount an UPD VHDX disk if the user is currently using it on the RDS server.

mount upd vhdx file

As you can see, the VHDX disk contains a set of folders and files of a standard user profile. At logon, a user gets completely transparent access to the data stored in the profile.

user profile disk folders

On the side of RD Session Host server, a .vhdx user’s file is mounted to the C:\users\<username> and looks like this:

mounted upd vhd disk

Note that the UPD drive is bound to the RDS server Windows OS version. You can’t transfer (use) an UPD user profile from an RDS server from one version of Windows Server to another.

Data is written to the vhdx file in real time. It means that when copying data to a user profile on an RDS server, the size of the vhdx file on the shared storage is incremented immediately.

If the user profile folder already exists in the system, the folder with an old profile is renamed to the <username>-BACKUP-<number>.

 

upd old profile backup

The VHDX disk is mounted when the user session starts on a VDI or RDS server. A list of connected UPD disks with profiles can be listed using the mountvol utility.

By default, a User Profile Disk contains all the user profile contents. However, you can exclude certain folders from the list of synchronized directories in the RDS collection settings, or specify that only certain folders should be saved. Thus, all the changes made during the user’s terminal session to the folders in the list of excluded directories are not saved into the VHDX disk on the shared folder.

exclude folder fron profile disk

The second option allows you to configure the saving only the specified directories in the UPD profile.

include folder

If necessary, the last option allows you to implement the scenarios for saving the settings of the Start Screen, which are stored in appsfolder.itemdata-ms file. In this example, we have only added the path to \AppData\Local\Microsoft\Windows folder as an additional path to be saved in the UPD.

include folder user profile disk

Resizing User Profile Disks Using PowerShell

You can extend the virtual vhdx drive with the user’s UPD profile using the PowerShell cmdlet Resize-VirtualDisk from the Hyper-V module.

Net use U: \\rdvh1\DemoLabOficeApps
Resize-VHD -Path u:\UVHD-<SID>.vhdx -SizeBytes 40GB
Net use U: /delete

If you want to run the Resize-VHD cmdlet from a desktop with Windows 10, you must install the feature Hyper-V -> Hyper-V Platform -> Hyper-V Services.

install Hyper-V-Services feature in Windows 10

Now you need to extend the volume from the GUI of the Disk Management console (Action -> Attach VHD -> Extend volume).

Extend volume on the vhdx disk

Or use following PowerShell script to automatically extend the vhdx file to the maximum available size:
<#
.Synopsis
This script extend size of VHDX file and resize the disk partition to Max
#>
Param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[alias("Path")]
[string]$vhdxFile,
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[alias("Size")]
[int64]$vhdxNewSize
)
begin{
try {
Mount-VHD -Path $vhdxFile -ErrorAction Stop
}
catch {
Write-Error "File $vhdxFile is busy"
Break
}
$vhdx = Get-VHD -Path $vhdxFile
if ($vhdx.Size -ge $vhdxNewSize){
Write-Warning "File $vhdxFile already have this size!"
$vhdx | Dismount-VHD
Break
}
}
process{
Dismount-VHD -Path $vhdxFile
Resize-VHD -Path $vhdxFile -SizeBytes $vhdxNewSize
$vhdxxpart = Mount-VHD -Path $vhdxFile -NoDriveLetter -Passthru | Get-Disk | Get-Partition
$partsize = $vhdxxpart | Get-PartitionSupportedSize
$vhdxxpart | Resize-Partition -Size $partsize.SizeMax
}
end{
Dismount-VHD -Path $vhdxFile
}

Note that you can’t extend the user’s UPD disk with an active RDS session.

To reduce the size of the UPD file (assuming that you deleted the user’s data inside the vhdx file and the file size on the disk is less than the size assigned to it), you can use the commands:

resize-VHD \\rdvh\DemoLabOficeApps\UVHD-<SID>.vhdx –ToMinimumSize

And then:

Optimize-vhd -path \\rdvh1\DemoLabOficeApps\UVHD-<SID>.vhdx -mode full

So, we have discussed the major peculiarities of User Profile Disks in RDS/VDI solutions running Windows Server 2016 and 2012 R2. UPD configuration is much easier than the configuration of roaming profiles or redirected folders. The disks are connected to the RDS collection and can’t be damaged when using the shared profile by several servers (unlike the standard profiles). The User Profile Disks can be stored in SMB shares, CSV, SOFS, SAN or on the local disks. Also, Microsoft notes that the speed of loading the user’s desktop environment in case of using UPD is reduced.

If you are planning to store UPD profiles on DFS servers, be aware that they must have Windows Server 2012 R2 installed. If you are using previous versions of Windows Server, you will get an error:

Unable to enable user disks on rVHDShare. Could not create template VHD.  Error Message: The network location "\\woshub.com\namespace\UserProfileDisk" is not available.

Also it is desirable to use the version SMB 3.02 on the file server side (Windows Server 2012 R2) or higher.

Anyway, since User Profile Disks is a relatively new technology, prior to mass UPD implementations, it is recommended to test their work and possible problems in a test environment.

 

17 comments
1
Facebook Twitter Google + Pinterest
previous post
The WinRM client received an HTTP bad request status (400)
next post
How to Convert Install.ESD to the Bootable .ISO Image in Windows 10

Related Reading

Fix: The Requested Certificate Template is Not Supported...

January 9, 2023

PowerShell: Unable to Resolve Package Source

December 14, 2022

How to Install .NET Framework 3.5 on Windows...

December 12, 2022

How to Install and Configure Free Hyper-V Server...

November 22, 2022

How to Enable Maintenance Mode on Exchange Server?

November 16, 2022

17 comments

Thiru August 16, 2016 - 12:40 pm

Can we delete all VHDX files ? It is occupying arround 18 GB of space. please suggest. Thanks

Reply
Silver August 22, 2016 - 9:28 am

If these vhdx files are not used , of course you can delete them. 
If you are not sure – rename files and look at the operation of the system.

Reply
Marc September 29, 2016 - 11:36 am

We are implementing VDI currently and we only have a couple of users on a pooled desktop using VDI with UPDs.  Someone of these user will sometimes get logged in with a temporary profile.  This is extremely problematic.  I have searched everywhere and cannot figure out why this is happening.  Even on the data server where the UPDs are stored, it shows them having a connected to the UPD and all folder redirects are working but the settings that they change that are saved in the UPD are not coming through.  Any tips on how to solve this issue??

Reply
admin September 30, 2016 - 5:04 am

Do you use Round Robin DNS with farm name on each host in RDS farm?
This is wrong for server 2012. Try to create an A record with the farm name in DNS, which then refers to the broker address/
On the broker server create a registry entry:
Path: HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Cluster Settings
Type: REG_SZ
Value for desktop collection: TSV: // MS Terminal Services Plugin.1.Name
Value For VDI: TSV: //VMResource.1.Name

Reply
Marc December 7, 2016 - 3:07 pm

No we do not use a Farm, these are Virtual Desktops.

We are using the RD Virtualization Host Method with a MasterImage to create each user their own VM. Not the RD session Host Method that you are referring to. So your fix for the Registry does not apply.

Reply
Luke July 19, 2018 - 8:54 am

Are UPS disks required? If we’re happy with pure folder redirection to their respective servers…?

Reply
admin July 24, 2018 - 6:44 am

You can use User Profile Disks together with the Redirected Folders

Reply
Suhil February 23, 2019 - 9:51 am

In 2016 I noticed a phenomenon that you cannot mount/access the UPD disk with domain admin. It only worked as a local admin.

On the file share that a UPD was stored (and UPD was dismounted when user wasn’t logged in) – this was the case to login as a local admin.

On the RDS session host that a UPT was mounted (when a user was logged in) – again this was the case to login as a local admin to access the files on the UPD.

Reply
Nicholas July 5, 2019 - 2:43 am

can i edit the users registry setting for short date format in the UPD

Reply
admin July 8, 2019 - 4:36 am

Mount user’s UPD and load the registry hive as follows:
1) Run regedit
2) Select the menu File – > “Load Hive”
3) Go to the mounted drive and select the NTUSER.DAT file
4) Don’t forget to unload the hive after editing

Reply
Dave November 14, 2019 - 1:44 pm

We use UserProfileDisk (RDS) on an Server 2016. But when a lot of users connect to the Server 2016, every UPD maps to an drive letter, so sometimes the networkdrives are occuped with the UPD-Mapping Drives.

Can i exclude for the mapping some letters used for networkdrives like T:\ I:\ and J:\?

Reply
Tobi February 10, 2020 - 11:31 am

Hi, thank you for this article. Do you know a way of switching back from UPDs to a “normal” roaming profile? We have performance issues on one 20102R2 RDS-Server and i want to see if this has to do with the UPSs.

Reply
Anyone seen user profiles setup like this? .vhdx April 2, 2020 - 1:01 pm

[…] Originally Posted by mavhc Just for RDS, right? Yes, only for RDS. UPDs are configured when you first set up the RDS server. User Profile Disks on Windows Server 2012 R2 / 2016 RDS | Windows OS Hub […]

Reply
Mike March 17, 2022 - 5:24 am

Where could I grab the ShowUPDFolderDetails.ps1 file now that gallery on technet has been removed ?

Reply
Ryan August 3, 2022 - 4:32 pm

“Note that the UPD drive is bound to the RDS server Windows OS version. You can’t transfer (use) an UPD user profile from an RDS server from one version of Windows Server to another.”

How do migrate 2012R2 RDSH Farm using UPD to 2019 RDSH Farm?

Reply
Krisztian December 3, 2022 - 7:20 pm

Two weeks ago we have to install a new server (Windows S. 2012R2) as terminal server. There was ServerA ; ServerB; and now ServerC We tried to clone the ServerB to ServerC but because of issue with the Uid we decided to install a brand new system.

After the clean install of windows ready, we:

install some application
patches
put to domain
etc..etc..
After this step we put this ServerC to the session host server group. Configure everything as the ServerA and ServerB.

–> Login as domain user, and test…–> Everything fine –> Login as local administrator –> Local administrator get TEMP profile

Rollback an earlier snapshot and test again: –> Login as local administrator –> Local administrator fine!

–> Put server as session host..configure everything –> Login as domain user, and test…–> Everything fine –> Login as local administrator –> Local administrator get TEMP profile

Any idea what the hack is goin’? May i miss something? Why local administrator get Temp profile after add the server as a new RD session host?

Reply
admin December 9, 2022 - 1:56 pm

Do you use User Profile Disks (UPD)? If so, then this is the reason, since the UPD can only be connected to one RDSH at a time.
if your admin session is active on ServerA then if it is logging in to ServerC, it can’t attach the UPD as it’s already in use, so a temporary profile is used.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023
  • Adding Trusted Root Certificates on Linux

    January 9, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
  • Managing Printers from the Command Prompt in Windows 10 / 8.1
  • Fix: RDP Authentication Error Has Occurred – The Function Requested Is Not Supported
  • How to Disable NTLM Authentication in Windows Domain?
  • Windows Server Licensing for Virtual Environments
  • Installing a Free Let’s Encrypt TLS/SSL Certificate on IIS Web Server / RDS
  • Configuring SSO (Single Sign-On) Authentication on Windows Server RDS
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top