ProfileUnity Logoff Script is terminated early on XenDesktop

Product: ProfileUnity-FlexApp  

Product Version: N/A

Expires on: 365 days from publish date

Updated: December 30, 2014



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


Option A) Modify the GPO to point to the logoff-shutdown.vbs script from old setting "logoff.vbs". This file is located where the client files reside (for instance, \\domaincontroller\netlogon\profileunity). This logoff script will wait until ProfileUnity is finished and then do a shutdown.

Option B) Another option would be to change GPO from "logoff.vbs" and point the GPO to "LwL.ProfileUnity.Client.Logoff.exe"

Step 1) Edit the ProfileUnity GPO, Logoff Script:

    • Script Name: \\<\netlogon\ProfileUnity\LwL.ProfileUnity.Client.Logoff.exe
    • Script Parameters: <Empty>

Step 2) Edit the "LwL.ProfileUnity.Client.Logoff.exe.config" located in ..\netglogon\profileunity directory

Change setting:

      <setting name="Shutdown" serializeAs="String">



      <setting name="Shutdown" serializeAs="String">


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.


Note: Option "B" logoff with "LwL.ProfileUnity.Client.Logoff.exe" will not work if the O/S is Windows XP or Windows 2003.


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


Article is closed for comments.