Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community
Easier User Data Management with User Profile Disks in Windows Server 2012
Published Sep 07 2018 09:14 PM 57.2K Views
First published on CloudBlogs on Nov, 13 2012

Hi, this is Rob Leitman. I’m a developer working on the Remote Desktop Virtualization team. This post describes the new user data management available in Windows Server 2012.

In an earlier post, we described the different options for profile management in Windows Server 2008 R2 . For Windows Server 2012, we wanted to find a simpler way to manage user data—compared to using roaming profiles, UE-V , or folder redirection. (Of course, these technologies can be used together fruitfully. For more information, see User State Virtualization .)

The simpler way is user profile disks. User profile disks store user and application data on a single virtual disk that is dedicated to one user’s profile. One of the key challenges to pooled virtual desktop deployments is easily maintaining the user settings and data; this is because this information is discarded at logoff when a pooled virtual desktop image is rolled back to its initial state. User profile disks provide an easy way to store the user settings and data on a separate virtual disk that is reattached at logon, so the user data isn’t discarded when the virtual machine rolls back.

User profile disks are completely transparent to the user—users can save documents to their Documents folder (on what appears to be a local drive) and change their background wallpaper and app settings while, at the same time, all personal settings persist when connecting to different computers in a virtual desktop collection or session collection.

This provides Admins with the reduced management and storage benefits of pooled virtual desktops while still providing the personalization of personal virtual desktops.

User profile disks offer several advantages:

  • Configuration and deployment is simpler than roaming profiles or folder redirection.
  • User profiles can be maintained even on pooled virtual desktops that get rolled back after logoff.
  • Logon and logoff times are reduced.
  • Previously, profiles could be corrupted if used simultaneously on multiple computers. User profile disks are specific to the collection, so they can’t be used on multiple computers simultaneously.
  • Administrators can have granular control of exactly which locations get saved to the virtual hard disk (VHDX).
  • User profile disks can be stored on Server Message Block (SMB) shares, cluster shared volumes, SANs, or local storage.
  • In pooled virtual desktop collections, user profile disks work with virtual machines running both Windows 8 and Windows 7 with Service Pack 1 (SP1).

Some things to remember about user profile disks:

  • User profile disks are available only in pooled virtual desktop collections and session collections—not in personal virtual desktop collections.
  • Share permissions are automatically set up by the management tools.
  • Use Server Manager or Windows PowerShell to manage user profile disks.
  • User profile disks are for a single collection only. A user connecting to two different collections will have two separate profiles. If you want to synchronize settings, refer to Microsoft User Experience Virtualization.
Setting up user profile disks

User profile disks can be enabled during session creation by using the wizard in Server Manager, as shown in the following image.

When you enable user profile disks, the ACL on the storage location will be set automatically.

To set properties for all user profile disks, click the collection in Server Manager, click Tasks in the Properties pane, and then click Edit Properties . Now, click User Profile Disks in the left pane, as shown in the following image.

These properties may also be set by using the Windows PowerShell cmdlet, as shown in the following command output.

PS C:Windowssystem32> import-module RemoteDesktop
PS C:Windowssystem32> Set-RDSessionCollectionConfiguration –?
NAME
Set-RDSessionCollectionConfiguration
SYNTAX
Set-RDSessionCollectionConfiguration [-CollectionName] <string> -DisableUserProfileDisk
[-ConnectionBroker <string>]  [<CommonParameters>]
PS C:Windowssystem32> Set-RDSessionCollectionConfiguration -CollectionName QuickSessionCollection -EnableUserProfileDisk -MaxUserProfileDiskSizeGB 20 -DiskPath \ProfileSvrUserProfileDisks
PS C:Windowssystem32>

Following is a list of definitions of the user profile disk properties in Server Manager and the equivalents in Windows PowerShell.

Server Manager

Windows PowerShell

Definition

Enable user profile disks

EnableUserProfileDisk

Turn on this feature.

DisableUserProfileDisk

Turn off this feature.

Maximum size (in GB)

MaxUserProfileDiskSizeGB

Maximum size of the virtual disk (VHDX) used to store a single user’s profile.

Location

DiskPath

Location where all VHDX files are stored.

Store only the following folders on the user profile disk / Include the following folders

IncludeFolderPath

List of folders in the user profile that will be preserved on the user profile disk. All other folders in the user profile will not be preserved.

IncludeFilePath

List of files in the user profile that will be preserved on the user profile disk. All other files in the user profile will not be preserved.

Exclude the following folders

ExcludeFolderPath

List of folders in the user profile that will not be preserved on the user profile disk. All other folders in the user profile will be preserved.

ExcludeFilePath

List of files in the user profile that will not be preserved on the user profile disk. All other files in the user profile will be preserved.

Note : If you set IncludeFolderPath and/or IncludeFilePath , you may not set ExcludeFolderPath and/or ExcludeFilePath . Likewise, if you set ExcludeFolderPath and/or ExcludeFilePath , you may not set IncludeFolderPath and/or IncludeFilePath .

How user profile disks work

During first logon, a virtual disk (VHDX) is created from a template disk . This VHDX is attached to the virtual machine or RD Session Host server that the user is logging on to. The profile service is then notified to use this VHDX as the location for the user’s profile. When the user logs off, the VHDX is then detached from the virtual machine.

By default, the entire user’s profile is stored on the user profile disk. This includes the Documents folder, the user’s registry hive (holds application and Windows settings), and much more .

On subsequent logons to the collection, the VHDX is remounted to whatever virtual machine or RD Session Host server the user is logging on to. The user then has access to everything in his or her profile, even if this is a different virtual machine, or if the virtual machine has been rolled back to a clean state between logons.

The following diagrams show how the VHDX moves as necessary to follow the user in a session-based desktop deployment:

1. On the initial logon, the user gets a session on RDSH1, and the user profile disk VHDX gets mounted as a drive on RDSH1.

2. On the next logon, the user gets a session on RDSH2, and the user profile disk VHDX is now mounted as a drive on RDSH2.

The same storage is used in both cases, so the user’s profile follows their session.

The process is similar for a virtual machine-based desktop deployment:

1. On the initial logon, the user initially gets assigned VM 1-1 on RDVH 1. The user profile disk is attached to the virtual machine that the user logs on to.

2. On the next logon, the user gets assigned to VM 2-2. (Due to rollback, all virtual machines are identical, so this works on any virtual machine the user gets—regardless of the RD Virtualization Host server to which that virtual machine belongs.) The user profile disk follows the user and is attached to VM 2-2.

Troubleshooting

To verify that user profile disks are working, you can run the mountvol command inside the user session without any parameters. This will show you a disk mounted at the location of the user’s profile, as shown here.

PS C:Userstestuser2> mountvol
Creates, deletes, or lists a volume mount point.
Possible values for VolumeName along with current mount points are:
\?Volume{133621a2-d761-11e1-93e8-806e6f6e6963}
C:
\?Volume{ac90ee68-0044-11e2-93f9-0019b9168fa8}
C:Userstestuser2

In addition, you can look in the user profile disk location and see the VHDX created for the user with the user’s SID contained in the file name, as shown in the following output.

PS C:Userstestuser2> dir \contoso3userprofiledisks
Directory: \contoso3userprofiledisks
Mode          LastWriteTime        Length    Name
----          -------------        ------    ----
-a---         9/21/2012   3:28 PM  239075328 UVHD-S-1-5-21-1602883023-82254803-4017812817-1606.vhdx
-a---         9/21/2012   3:12 PM  205520896 UVHD-template.vhdx

Summary

User profile disks offer many advantages for managing user profiles. I hope you take some time to try them out.

NOTE: Questions and comments are welcome.  However, please DO NOT post a request for troubleshooting by using the comment tool at the end of this post.  Instead, post a new thread in the RDS & TS forum .

2 Comments
Version history
Last update:
‎Sep 07 2018 09:14 PM