Problem:
XenDesktop VMs need ProfileUnity to save portability then power off while other VMs do not need power off
Resolution:
The default behavior in XenDesktop at user logoff is to power off the machine and it will revert back to snapshot. However, it frequently shuts down the VM before the logoff process is complete, breaking ProfileUnity portability save process. The workaround of this issue is to disable XenDesktop shutdown-at-logoff behavior but let ProfileUnity perform the shutdown after the save process is complete. This KB has the details: KB: ProfileUnity Logoff Script Is Terminated Early On XenDesktop
However, not all machines that run ProfileUnity need power off at logoff. In fact, it may cause unintended shutdown on terminal servers or application servers like XenApp. Therefore, we want to isolate this logoff behavior to XenDesktop only, and it needs a separate GPO with a different logoff process.
- Create a separate OU in the AD for XenDesktop VMs if you don't already have one. You may move the existing VMs' Computer Accounts to this OU but be sure that your XenDesktop is configured to use this OU for Target OU for Computer Accounts so that they will receive the proper GPO in the future.
- Go to ProfileUnity client tools directory (%systemroot%\SYSVOL\domain\scripts\ProfileUnity) on one of the Domain Controllers, and create a new directory called "XenDesktop". Copy LwL.ProfileUnity.Client.Logoff.exe and LwL.ProfileUnity.Client.Logoff.exe.config over to XenDesktop directory.
- Edit LwL.ProfileUnity.Client.Logoff.exe.config. Change setting:
<setting name="Shutdown" serializeAs="String">
<value>False</value>
To
<setting name="Shutdown" serializeAs="String">
<value>True</value>
- Duplicate the exist ProfileUnity GPO and name it "ProfileUnity XenDesktop. Change the logoff script path from the current "\\<domain>\netlogon\ProfileUnity\LwL.ProfileUnity.Client.Logoff.exe" to "\\<domain>\netlogon\ProfileUnity\XenDesktop\LwL.ProfileUnity.Client.Logoff.exe". Also verify that you have loopback processing enabled. Link "ProfileUnity XenDesktop" to your XenDesktop OU to apply this GPO to your XenDesktop machines.
Product: ProfileUnity
Product Version: 6.0 and above