{"id":290,"date":"2017-10-14T12:54:15","date_gmt":"2017-10-14T11:54:15","guid":{"rendered":"http:\/\/kolbi.cz\/blog\/?p=290"},"modified":"2017-12-15T17:29:49","modified_gmt":"2017-12-15T16:29:49","slug":"user-file-type-association-roaming-on-server-2016-with-citrix-user-profile-manager","status":"publish","type":"post","link":"https:\/\/kolbi.cz\/blog\/2017\/10\/14\/user-file-type-association-roaming-on-server-2016-with-citrix-user-profile-manager\/","title":{"rendered":"User File Type Association Roaming on Server 2016 with Citrix User Profile Manager"},"content":{"rendered":"<p>here we go again with an ongoing issue, that most of my customers have after updating their XenApp environments to Server 2016.<\/p>\n<p>recently a customer asked me, why a user can not associate .log files with Notepad++ on his XenApp server &#8211; well, actually the user CAN do that, but after a logoff, the association is gone. i tried to reproduce that in my lab and indeed the association IS gone after logoff (using Citrix UPM). this even happened on the SAME server (without PVS, but deleting the cached profile after a logoff). the other issue is, that an administrator can not set the associations based on user or groups anymore (that was possible in older windows versions) &#8211; but you can set it server based (which does not help for special users).<\/p>\n<p>if you dont know about this issue, some additional information is needed to understand the problem: Microsoft added a new &#8220;security&#8221; mechanism to avoid malware filetype hijacking. you can read more about that <a href=\"https:\/\/blogs.technet.microsoft.com\/mrmlcgn\/2013\/02\/26\/windows-8-associate-a-file-type-or-protocol-with-a-specific-app-using-gpo-e-gdefault-mail-client-for-mailto-protocol\/\">here<\/a>. <strong>long story short<\/strong>: when a user associates an application with a filetype, a hash value is written to his registry, which should make it harder to change it through a 3rd party application (which is not true &#8211; stay tuned for more information about that). Microsoft states following about this hash:<\/p>\n<blockquote><p><span style=\"color: #000000;\"><em>However In Win 8, the registry changes are verified by a hash (<span style=\"color: #ff0000;\"><strong>unique per user and app<\/strong><\/span>)\u00a0 that detects tampering by apps. In the absence of a valid hash, we ignore the default in the registry.\u00a0<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>For a 3rd Party Application, the Filetypes including the hash are written to this registry location:<br \/>\n<strong>HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.txt\\UserChoice<\/strong><\/p><\/blockquote>\n<p>First i thought, the file type association roaming is not working because of this hash (but Microsoft states, it is NOT unique by server). actually there are some Citrix articles stating, that roaming of FTA should work with UPM and we even opened a case with Citrix. they told us:<\/p>\n<blockquote><p><em><strong>Expected behavior with Windows 10\/8 and Server 2012 R2\/2016. Currently MS and Citrix have no fix but are actively working on this issue.<\/strong><\/em><\/p><\/blockquote>\n<p>Wow. that means, a basic windows function is broken on Server 2016? If you have read my other article about a similar issue, then you might be not surprised (i wasnt). BUT wait Citrix. Why is there this article then:\u00a0<a href=\"https:\/\/support.citrix.com\/article\/CTX221380\">https:\/\/support.citrix.com\/article\/CTX221380<\/a>?<\/p>\n<blockquote><p><strong>Profile Management: Occasionally, File Type Association (FTA) Fails to Roam on Windows 10 and Windows Server 2016<\/strong><\/p><\/blockquote>\n<p>Doesnt this mean, that it actually IS supported and SHOULD work? you will find a lot of different information about this &#8220;issue&#8221;, but Citrix documentation is a jungle and you have to get all pieces on your own and put them together. <a href=\"http:\/\/www.carlstalhood.com\/citrix-profile-management\/\">Carl Stalhood<\/a> does an awesome job on this and offers very detailed documentations &#8211; much better than the Citrix Knowledge Base.<\/p>\n<p>if you check his documentation about configuring Citrix UPM, he states:\u00a0<strong><em>Full support for roaming Start Menu and\/or File Type Associations requires UPM 5.7 or newer, and VDA 7.13 and newer.<\/em><\/strong><\/p>\n<p>now im really confused. Citrix says it doesnt work and he states it is supported? i followed his guide to enable FTA roaming and it worked somewhat, but it broke my start menu. i was NOT able to get FTA and Start Menu working with UPM 7.15 on Server 2016. i had a deeper look at this and found a workaround that is working fine in my LAB.<\/p>\n<p>i noticed, that FTA and the hash ARE being roamed by Citrix UPM (and the hash is correct &#8211; even on a different server), but the associations do not work &#8211; so something seems to be missing. roaming the UsrClass.dat DOES make it work, but breaks the Start Menu. i cant have both it seems, or something is completely missing in the documentation (or its a bug). however &#8211; it turned out, that you need only<\/p>\n<blockquote><p><strong>HKCU\\SOFTWARE\\Classes\\Applications<\/strong><\/p><\/blockquote>\n<p>from the UsrClass.dat part of the registry to get the FTA working again (procmon rocks). this is at least true for 3rd party applications, but sadly Citrix UPM does NOT support inclusions or exclusions in the UsrClass.dat &#8211; you can only have it all or nothing. argh. but what if i manually save just this part?<\/p>\n<h1><strong>THE WORKAROUND<\/strong><\/h1>\n<p>first make sure that following is true for your environment:<\/p>\n<ul>\n<li>Server 2016 (fully patched &#8211; i have up to october cumulative installed)<\/li>\n<li>XenApp 7.15 with UPM 7.15 (i did NOT test older Versions)<\/li>\n<li>following UPM settings.\n<ul>\n<li>enable default exclusions of directories (i have everything ticked)<\/li>\n<li>delete locally cached profiles on logoff<\/li>\n<li>enable default exclusion list (registry) &#8211; do NOT select &#8220;Speech_OneCore&#8221;<\/li>\n<li>i have streaming on (but i dont think it matters)<\/li>\n<li>NO inclusions or exclusions defined (UsrClass.dat is excluded in the ini, if you deleted that you need to add the exclusion in the GPO)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-296\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting-1024x543.png\" alt=\"\" width=\"1024\" height=\"543\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting-1024x543.png 1024w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting-300x159.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting-768x407.png 768w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting-1170x620.png 1170w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/upm_setting.png 1370w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>NOW here comes the important part. just with this configuration, UPM will NOT load the\u00a0<strong>HKCU\\SOFTWARE\\Classes\\Applications<\/strong> contents, because this is in the UsrClass.dat and that file is excluded by default in the UPM ini.<\/p>\n<p>i actually wanted only these settings and not the full UsrClass.dat and therefore implemented a registry export on logoff and an import on logon &#8211; just with this simple commands:<\/p>\n<blockquote><p><strong>reg.exe export HKCU\\SOFTWARE\\Classes\\Applications %APPDATA%\\Applications.reg \/y<\/strong><br \/>\n<strong>reg.exe import %APPDATA%\\Applications.reg<\/strong><\/p><\/blockquote>\n<p>this will export the needed registry keys into the userprofile and on the next login it will restore them. the best way to do that is using the GPO logon and logoff option (the same GPO where i have Citrix UPM configured, you might have to enable loopback processing).<\/p>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_setting.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-299 size-full\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_setting.png\" alt=\"\" width=\"886\" height=\"220\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_setting.png 886w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_setting-300x74.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_setting-768x191.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logoff.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-297\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logoff.png\" alt=\"\" width=\"836\" height=\"558\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logoff.png 836w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logoff-300x200.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logoff-768x513.png 768w\" sizes=\"auto, (max-width: 836px) 100vw, 836px\" \/><\/a><\/p>\n<blockquote><p>Action: Logoff<br \/>\nScript Name: reg.exe<br \/>\nScript Parameters:\u00a0export HKCU\\SOFTWARE\\Classes\\Applications %APPDATA%\\Applications.reg \/y<\/p><\/blockquote>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logon.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-298\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logon.png\" alt=\"\" width=\"844\" height=\"564\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logon.png 844w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logon-300x200.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/gpo_logon-768x513.png 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/a><\/p>\n<blockquote><p>Action: Logon<br \/>\nScript Name: reg.exe<br \/>\nScript Parameters:\u00a0import %APPDATA%\\Applications.reg<\/p><\/blockquote>\n<p>i have no other setting in my UPM (nothing for the Start menu roaming) and now i have User FTA and Start menu working on different Servers! i successfully changed .log files to Notepad++, logged out and logged in on another server and it worked.\u00a0 you can verify this in your UPM profile folder:<\/p>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-302 size-large\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg-1024x287.png\" alt=\"\" width=\"1024\" height=\"287\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg-1024x287.png 1024w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg-300x84.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg-768x216.png 768w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg-1170x328.png 1170w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg.png 1518w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>and the reg file contains the missing information to make the FTA work correctly:<\/p>\n<p><a href=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-301 size-large\" src=\"http:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content-1024x421.png\" alt=\"\" width=\"1024\" height=\"421\" srcset=\"https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content-1024x421.png 1024w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content-300x123.png 300w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content-768x316.png 768w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content-1170x481.png 1170w, https:\/\/kolbi.cz\/blog\/wp-content\/uploads\/2017\/10\/applications_reg_content.png 1338w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>of course your users need the permission to run reg.exe &#8211; which might not be desired, but this is a workaround and i will inform Citrix about it.<\/p>\n<p><em><strong>UPDATE 23.10.2017:<\/strong><\/em> if you still encounter StartMenu corruption, you might configure a delay before deleting the cached profiles in UPM.<\/p>\n<p>That was it &#8211; i hope you enjoy this post and if you like to donate, i would appreciate it very much:<\/p>\n<p>BTC:\u00a01G7HETp7j5dq422mTg1VNB1yph9m3eKgX1<br \/>\nLTC:\u00a0LdmnKE7SnKAzKPrs6MrrPFXskuP1qRVBcD<br \/>\nETH:\u00a00x89c83770e89ae08e856EE239e477BC758FCf3Bf8<br \/>\nXMR:\u00a047y7gzD2DmjSBhKyaxQ2C7RUpLgwzr2hYGu2Ui6NcAi2feChfVR99nhBvJPQxPqhEpRfuy9pAr5ypghETPWQ3MQGCdYSK3u<br \/>\nPayPal:\u00a0<a href=\"https:\/\/www.paypal.me\/Kolbicz\">https:\/\/www.paypal.me\/Kolbicz<\/a><\/p>\n<p>Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>here we go again with an ongoing issue, that most of my customers have after updating their XenApp environments to Server 2016. recently a customer <a class=\"mh-excerpt-more\" href=\"https:\/\/kolbi.cz\/blog\/2017\/10\/14\/user-file-type-association-roaming-on-server-2016-with-citrix-user-profile-manager\/\" title=\"User File Type Association Roaming on Server 2016 with Citrix User Profile Manager\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":297,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[],"class_list":["post-290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-citrix","category-windows"],"_links":{"self":[{"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":17,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/posts\/290\/revisions\/337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/media\/297"}],"wp:attachment":[{"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kolbi.cz\/blog\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}