Microsoft User Profile Disk with Citrix XenApp & XenDesktop

94 Shares

In the last couple of weeks I’ve been working on my upcoming whitepaper Turbo Containers Reference Architecture for Citrix, VMware & Microsoft RDSH Environments and also reviewing Claudio Rodrigues upcoming book RDS 2012 R2 Complete.

You’ve probably heard about Microsoft User Profile Disk (UPD) and learned that it only works for pure RDSH environments. It wasn’t until reviewing Claudio’s book and working on my whitepaper that got me thinking. What if that worked on Citrix…

ControlUp-blog-images-Calculate-user-profile

If you take a look at the post Troubleshooting Slow Logons Caused by a Large User Profile by ControlUp you’ll learn that it’s not only the size of the profile that matters, it’s also the number of files.

That got me thinking and worrying at the same time. You see, to be able to keep changes in Turbo Containers we need to roam the folder AppData\Local\Spoon\Containers. As you can see below from some small lab testing the folder contains 1984 files in 1208 folders. Yes it works fine with Citrix Profile Management and streaming, but I’m worried.

User Profile Disk Citrix 01

But that’s not the biggest problem. As more and more companies migrate to Office 365 the biggest challenges are the huge OST files. Yes Microsoft & Citrix recommends redirecting the file to a file share.

It’s not the optimal way, it’s recommended because it’s the ONLY way without 3 party products

Check the post Getting Started with Office 365 to get all the registry hacks to disable all annoying splash screens.

Last year FSLogix won Best of Synergy 2015 for their Profile Container Technology and this year they released FSLogix Office 365 Container that takes care of the OST part so it can be easily integrated with any other UEM solution. FSLogix supports both VDI & RDSH while LiquidwareLabs Profile Disk only support VDI.

That was before I sent an email and by pure luck included Claudio on CC. He had a theory which I instantly tested successfully. When we think about it, it’s INCREDIBLE that nobody has though about it before. The solution is so simple. Let’s do it.

User Profile Disk Citrix 02

User Profile Disk with Citrix

Head over to your file server and create a share where you’re going to host those UPD files. Add the computer objects with full NTFS rights and Share Permissions.

user-profile-disk-citrix-15upd-01

Then run the following command in PowerShell to create the User Disk Template.

User Profile Disk Citrix 10

The last digit 5 defines the size in GB of the VHDX template.

Now with all Profile Container technologies there’s a limitation that only allows the VHDX to be mounted once. Therefore you’ll need to create a folder for each OS/Silo and copy the template inside each of those sub folders.

User Profile Disk Citrix 05

To enable User Profile Disk in on your Citrix Servers run the following PowerShell command as a startup script:

You’ll also need to Enable the Policy Delete cached copies of roaming profiles in Computer Configuration – Administrative Templates – System – User Profiles.

Again, please be aware that you need to create a Group Policy for each of those OS/Silos pointing to the correct sub folder.

User Profile Disk Citrix 08

And that’s it. I’ve successfully tested this on Windows 8.1, Windows 10 1511/1607 (Anniversary Update), Windows Server 2012 R2 and Windows Server 2016.

Finally if you take a look at your share you’ll find some rather strange file names. So which VHDX belongs to which user?

User Profile Disk Citrix 04

There’s a great tool from the Microsoft Gallery called Sidder that resolves this problem.

User Profile Disk Citrix 09

FSLogix Killer?

So what now, is FSLogix out of business? Not at all, remember that FSLogix has been working with this tech for 3 years and their Profile Container offers so much more than only the Microsoft Cache Exhange Mode stuff.

More importantly, we’ll probably never see any kind of support from Microsoft or Citrix. So larger organizations will probably happily pay the $10 extra to get support and new innovations to the technology. And did I mention Windows 7 and later, 32 & 64 bit; Windows Server 2008 R2 and later support? Request FSLogix evaluation.

If organizations wants to save money, yes then it’s a go, but if that’s the case why don’t go Pure RDSH and get Microsoft support for UPD out of the box?

User Profile Disk Citrix 11

We want to credit this post to RDS MVP Toby Phipps for initially passing the UPD commands to Claudio back in November 2015.

94 Shares

Automation Framework Community Edition

The fastest way to build your lab environment.

Virtual Expo

Friday 30th of September 2022

44 thoughts on “Microsoft User Profile Disk with Citrix XenApp & XenDesktop”

  1. Couple of comments / questions…

    1. I assume login is much faster than UPM or other solutions because the profile is now local to the VM, can you confirm?
    2. Does this work with pooled and non-pooled catalogs?
    3. Now if someone could only figure out how we can migrate profiles between v2 and v5 successfully, then we might be able to get W10 migrations moving in full force.

    Awesome work!

    Reply
    • Thanks Nick, more test & results coming, running LoginVSI as we speak.

      1. Yes is should be much faster, not in my lab though, but with real world profiles, for sure.
      2. Yes works with both.
      3. Yes indeed, I think you can with FSLogix.

      Reply
  2. Is there a video somewhere of this being set up to make sure I’m not doing something wrong? Every time I log on to Windows 10 1607 with this configured, I get a temporary profile warning…

    Reply
  3. So does this work on windows2012 xenapp 6.5? From what I understand this eliminates citrix user profile manager?

    Reply
  4. Hi, I tried running the first powershell command on the file server to create the user user disk template, and I keep getting the following error:

    Exception calling “CreateUserDiskTemplate” : “”
    At line:1 char:1
    + (Get-WmiObject -ns root\cimv2\terminalservices -class win32_tssessiondirectory). …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WMIMethodException

    am I doing something wrong or missing something here?

    thanks

    Reply
  5. Do you have an example UvhdRoamingPolicy.xml that you can share? I am having troubles creating one for some reason…

    Thanks in advance!

    Reply
  6. What happens if you use XenApp and run ‘published app A’ from ‘server X’ and ‘published app B’ from ‘server Y’?
    FSLogix has some logic to handle that “dual access”…

    Reply
  7. Hello,

    I get it working on W2k12R2 but on Windows10 I get a temp profile after logon. Any ideas?

    Regards
    Martin

    Reply
  8. Thanks Trond this is just great. Just what i looking for! Works perfect here. Had some really big ussues with native roaming profile oder UPM from Citrix!
    Startmenu and default app settings were not saved with the new profile version v6 and ws16!

    Reply
  9. Thanks for great tutorial. Do you have any recommendations on what to exclude in the profile on 2012 r2 with xenapp 7.x?

    Is it still best practice to exclude %appdata%\local and locallow?

    Reply
  10. Hello,

    What about Citrix Support ? Is it an official solution or just a tweak ?

    Can we use it in production environnement for XA 7.13 ?
    Thank you

    Seb

    Reply
  11. Can you tell me what you mean when you say, “Again, please be aware that you need to create a Group Policy for each of those OS/Silos pointing to the correct sub folder.”? Is there a GPO that needs created besides deleting cached copies? If so, I’m not seeing where you configured that.

    Reply
      • Got it working! On one server that is, the other 2 app servers will not open an Outlook profile. I’m getting an error stating that the profile could not be configured. I made sure that the policy is being applied and that the permissions on the share are correct. Is there anything else that I could be missing?

        Reply
      • I have 1 GPO at the top level OU to Delete Cached copies and multiple sub-OUs under that for each OS that will inherit that setting since it is not unique. Why would I have to create multiple GPOs for each OS if I am setting the same policy? Are the instructions missing an additional policy that needs to be set?

        Reply
  12. Hi, I am having an issue where I am deploying this solution to a Server 2016 XenApp environment. I have used this method for Server 2012 R2 flawlessly (thanks by the way!).

    I am getting this error;

    Exception calling “CreateUserDiskTemplate” : “”
    At line:1 char:1
    + (Get-WmiObject -ns root\cimv2\terminalservices -class win32_tssessiondirectory). …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WMIMethodException

    The remote desktop role is installed and remote desktop is enabled. The Citrix Desktop Agent is installed also. I have used these instructions before without issue.

    Is there a slightly different command for Server 2016?

    Many Thanks.

    Reply

Leave a Comment