ProfileUnity Logoff Script is terminated early on XenDesktop

Product: ProfileUnity-FlexApp  

Product Version: 6.8.3 R2 or later.

Expires on: 365 days from publish date

Updated: November 5, 2020



Portability Settings do not complete their save at logoff.

In XenDesktop environments, the ProfileUnity logoff script is terminated early.



Some or all Portability .7z files are missing from the network store after logoff. Portability Settings are saved in the order they are listed in the configuration settings, so you may see the first several in the list created, but settings further down the list may not be created at all. 


Possible Resolution(s):

This is usually caused by something killing the logoff script prematurely at logoff time.

There is a known issue with Citrix VDI environments powering off the machine before the logoff script can complete. Here is a link to the Citrix forum post discussing this issue:

The workaround for this issue is to follow CTX127482:

1. Log onto the Delivery Controller (also known as 'DDC', 'Desktop Delivery Controller', or 'Broker').

2. Open a PowerShell window as administrator by clicking Start->All Programs->Accessories->Windows PowerShell. Right-click on Windows PowerShell and click 'Run as Administrator'.

3. Type asnp Citrix* to load the Citrix PowerShell extensions.

4. Type the command Get-BrokerDesktopGroup. This will list the desktop groups. Scroll up and look for the 'Name' value for the desktop group. You will need to use this exact wording for the next command.

5. Type the following command, substituting the actual name of your desktop group where appropriate:

Set-BrokerDesktopGroup -Name "Desktop Group Name" -ShutdownDesktopsAfterUse $False

6. Run the Get-BrokerDesktopGroup command again and scroll up to the desktop group. Verify that the ShutdownDesktopsAfterUse value is now set to False.

7. At this point, XenDesktop will no longer restart desktops. 

8. In addition to the above to try and alleviate the Citrix process of the VDA restarting the guest OS prematurely before it has had a chance to complete all the actions of the logoff script (ProfileUnity and potentially Windows) ,  try the following setting in the VDA:-


           Set-BrokerDesktopGroup -Name XXX -SettlementPeriodBeforeAutoShutdown  to something             like to 120 seconds


Edit this file:

Look for this section and change the setting from "False" to "True":

LogoffShutsdown= True

10. Remove "Shutdown" option from user's start menu using GPO. 

There could also be a scenario where machines may shutdown before the logoff script is completed even though the broker may have been set to false (per article-

Power Management has settings to control the idle pool and how many VDI machines are available at any given time. If persay your set to 60%. What happens is when a user logs off, Citrix looks at the % and if the machine needs to be shutdown to maintain the proper percentage level, it will do so.  This power mechanism can cause machines to shutdown prematurely in order to maintain the power saving levels.



Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Article is closed for comments.