Easier User Data Management with User Profile Disks in Windows Server 2012

Easier User Data Management with User Profile Disks in Windows Server 2012

Rate This
  • Comments 17

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.

clip_image002

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.

clip_image004

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

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

 

 

 

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.

clip_image006

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.

clip_image008

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.

clip_image010

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.

clip_image012

 
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:\Users\testuser2> 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:\Users\testuser2\

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:\Users\testuser2> dir \\contoso3\userprofiledisks 
    Directory: \\contoso3\userprofiledisks
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.

Leave a Comment
  • Please add 7 and 5 and type the answer here:
  • Post
  • I tested this and it works flawless! But I think you should elaborate how this would work for other technologies. For example, if you use User Profile Disks in your Remote/Virtual Desktops and the user saves a document to their "Documents" this will only be available in Remote/Virtual Desktop but not on their fat client. What is the best practice then? Still use User Profile Disks but Exclude the "Documents" folder and use Folder Redirection there instead? I guess UE-V would be the best alternative but if the customer doesn't have this license?

  • Thanks very good article. The improvements seem to be very good, but I already started having the error that a temporary profile is being used by which  user disk profiles are not being accesible. Could you describe under what circumstances this might happen as I don´t know how to troubleshoot this new architecture.

  • The design is a disaster, go for another solution other than microsoft rds 2012, I temporary lost access to the share and now having ramdomly temp profile access scenario, same problema as 15 years ago when windows nt 3.51 was born

  • It works when it works...are there any known caveats? Or requirements for the backend storage? Finding it hard to find documentation on UPD anywhere...already asked the question here:

    social.technet.microsoft.com/.../0ac7d99b-b6b8-4a68-b6ba-f8d89cbd2d89

  • Is it possibls to store roaming userprofiles of Fatclients on userprofiledisks also?

  • In our system it was required that we had no space characters in the path of our profile disk share. Typing "\\server\RDS0 profile disks" into the location textbox without quotes did not work, but changing the share name to "\\server\RDS0ProfileDisks" did.

  • Got a question, during the profile disk configuration, we selected what we want to save in the client settings page. However we realised that alot of the things do not get saved, so we decided to store all data and settings. However it doesnt appear to be affecting on existing users. How do we update to reflect the new change we made?

  • UPD is still pretty new, and not alot of people have implemented this or troubleshoot it. I hope someone here can help. How do we recreate user from UPD, and how do we update user to use new changes made to UPD?

  • I'd like to echo Billy's issue, in that existing users who have logged in previously are not having their user profile disks created.  However new users are.

    Billy Sun, Apr 21 2013 10:06 AM

    Got a question, during the profile disk configuration, we selected what we want to save in the client settings page. However we realised that alot of the things do not get saved, so we decided to store all data and settings. However it doesnt appear to be affecting on existing users. How do we update to reflect the new change we made?

  • Where does the vhdx file reside the moment a user logs on to a server? Is that on the RDS or on the fileserver?

    Is it only mounting? or also a copy of the disk file?

  • Is it possible to increase the size of a single user upd?

  • Is it possible to migrate already existing local user profiles to ups?

  • Does user profile disk have quota management options?

  • We can only set the UVHD size that every user can get at the time of UVHD configuration.

    I don't think there is an option to set Per-User disk quota.

  • Resize-VHD –Path <to the .vhdx file> -SizeBytes xGB

Page 1 of 2 (17 items) 12