Wednesday, September 11, 2013

Using User Profile Disks (UPD) in combination with predefining the Modern UI Start Screen on RDS 2012 (appsfolder.itemdata-ms)

I was recently contacted by someone regarding one of my previous blog posts called Predefining and customizing the Modern UI Start Screen on RDS 2012 where I describe a way to create a predefined Start Screen layout for Remote Desktop Sessions running on Windows Server 2012 and still allow users to modify that predefined Start Screen to their needs.He was wondering how this method would work in combination with using User Profile Disks. I’ve also seen similar comments on that blog post in regards to that combination. Enough reason to test this combination in my lab and I hereby want to share the results with you.

If you’ve read my blog post you’ll know that the items on your Start Screen are not stored in a folder within your profile but are in fact stored in a binary file called appsfolder.itemdata-ms which is stored in %USERPROFILE%\appdata\local\microsoft\windows\.

With Use Profile Disks (UPD) you no longer use a (cached copy of) roaming profile. In stead, your profile is stored in a .VHDX file specific to your account which is placed on a central share. Upon logon a mount path is created under C:\Users\<username> that points to that .VHDX file on the share. This makes the solution fully transparent to the Operating System and applications. If you’ve used UPD before you will have noticed that the filenames of the .VHDX files hold the users SID, not the account name. To get a quick overview of what account name is coupled to what .VHDX file check out my script Retrieve usernames for a User Profile Disks (UPD) share in VDI environment on Microsoft TechNet Gallery.

Part of the configuration of UPD is to configure what folders of the profile you want to be part of UPD. In order to do so, open the RDMS as part of the Server Managed Console en edit the properties of your Session Collection.

image

Choosing the option “Store all user settings and data in the user profile disk” would obviously capture everything normally stored under C:\users\<username> and add that to the UPD. That will obviously also include the path of the appsfolder.itemdata-ms file (\appdata\local\microsoft\windows\). However in most cases you would want a more granular control of what’s going to be stored in the UPD. To do so you select the option “Store only the following folders on the User Profile Disk”. After that you can make a selection based on the most common folders. Notice however that you can only select the roaming part of your user profile data. This means that \appdata\local\ will be excluded, and thus so will the appsfolder.itemdata-ms file.

However, besides being able to select the most common folders you can also add additional files & folders as desired. To test this we add the following, which is a relative path to the file where the Start Screen is stored.

image

When we configure this (in combination with the configuration I refered to earlier) and log on with a test user, a UPD file is created successfully.

image

And the user seems to get the Start Screen Layout as pre configured.

image

However, when we look at the system drive of the RD Session Host Server we notice that a temperately profile has been created where we would have expected a mount point to the UPD file.

image

Upon logging off the user, the temp profile folder is obviously gone, but when we try to mount the UPD file we are presented with the following error:

image

Apparently in this scenario the .VHDX file doesn’t get detached properly. We manually detach the VHDX using Disk Management

image

We are now able to mount the .VHDX and check what’s inside and notice that the file we specified is not in there. (only the roaming part of the User Profile Data).

image

So apparently the method of selecting the file as an additional file does not work and causes the UPD to not be able to detach properly.

Does this mean that the combination with UPD simply does not work properly for this scenario? Upon some further testing  I discovered a workaround to make this work.

After removing the UPD file of the test user, in stead of adding the file inside the UPD configuration, we add the folder where the file resides.

image

Upon log on, again a VHDX file is successfully created and user is represented with the pre-defined Start Screen.

image

This time however we notice that that on the RD Session Host server the mount to the UPD file is successfully created (and no TEMP profile is showing).

image

When we do a drilldown inside this folder we see the desired behavior. The Windows Folder is a mounted folder.

image

Upon logging of the user, the UPD file is correctly detached, and when mounting the UPD file as an administrator we see that the folder \appdata\local\microsoft\windows is now part of the UPD file.

image

And so is the appsfolder.itemdata-ms file and as a result customization to the layout of the Start Screen can now be roamed to other servers within the Session Collection!

image

Final remarks: The ability to pre define the Start Screen has been improved in the R2 release of Windows Server 2012 and has become configurable using a GPO. More details on that: Predefining and customizing the Modern UI Start Screen on RDS 2012 R2

12 comments:

  1. Hi Freek,

    is there a way, to establish a administrative connection to a RD collection with selected UPD option, without to mount a vhdx?

    ReplyDelete
  2. Hi,

    Unfortunately there is no way (at least that I know of) to disable UPD for administrative purpose connections. I believe the best way for Microsoft to implement this would be to disable UPD when using the mstsc /admin switch. It makes sense to be able to disable UPD for administrative purpose connections because with the /admin switch you're able to log on to multiple RDSH servers within a single collection simultaneously, this causes subsequent logons to have a temporarily profile because the upd file can only be mounted once at a time, which is probably what you experience?

    ReplyDelete
  3. Hi Freek,

    Any good workaround for the issue you have described above?

    Thanks.

    Marcus

    ReplyDelete
  4. Hi Marcus,

    No unfortunately not at this time. I have however provided feedback to the Microsoft Product group about this. Hopefully this is something that will change in a future release.

    ReplyDelete
  5. Hi Freek. I love your blogs...they have really helped me. Thanks so much for the detailed postings.

    ReplyDelete
  6. Good information and very helpful. A question for you. Does this work for Classic mode as well for the Start Menu options? My programs and resources are wide open for all users. I attempted to control via Group Policy however it doesn't appear to work correctly in my envirnment. It might be a result of the 2003 PDC being used.

    ReplyDelete
  7. All good, but whatever we do, the user profile disk does not get mounted, and the user always gets a temporary profile. The UPD is created, but appears to contain nothing when manually mounted.
    Can anyone tell me why my UPDs do not mount?

    ReplyDelete
  8. Rigbey i had the same problem as you, I tried many things: edit registry, deleting users/Profile, deleting UDP... dint helped as long as UDP was turned on. I found my problem, it was drive compression what was causing problems. I turned off drive compression on drive where udp sits and problem gone.

    ReplyDelete
  9. Just Create a new collection for administrators without the User disk profile

    ReplyDelete
  10. Hi Freek,

    I am having a problem with UPDs in our environment. Most users are using UPDs fine in a pooled desktop. But we have one user that logs in the first time, It creates a UPD just fine, but after the logs off and logs back in the next day, She is logged in with a temporary profile. On the RDS host server in the event viewer we are getting a message "remote desktop virtualization host could not apply a user desktop for a user account with sid of XXXXXXXX . A temporary prile was enforced for the user. Verify that the profile disk settings are correct.
    Virtual deskop name: Pooled0
    Error:0x7B.139 Any ideas?

    ReplyDelete
    Replies
    1. Most likely the UPD did not successfully unmount af logon. Because a UPD can only be mounted once at the same time a subsequent logon with the UPD still mounted causes a temp profile. I would advise to check if and why the UPD did not unmount during logoff. Usually this is due to some 3rd party application that keeps some files open.

      Delete