Virtualization environments powered by FSLogix for profile management deliver a seamless user experience—until they don’t. One common issue experienced across Citrix, Azure Virtual Desktop (AVD), Remote Desktop Services (RDS), and VMware Horizon environments is FSLogix profile containers becoming locked due to incomplete session logoffs or attempts to launch multiple desktops or apps when single-session FSLogix is configured.
Here’s what typically happens:
This creates friction for both users and administrators, delaying access and increasing support overhead.
ControlUp offers the ability to detect and remediate these user profile container attachment failures. See the result of setting up this remediation action:
ControlUp provides a streamlined, automated solution to the FSLogix “the user profile failed to attach” issue, eliminating the need for manual intervention and accelerating resolution.
Download the support files (FSLogix Trigger Pack.zip) required for this solution here.
The role of each file:
In addition to these files, you’ll need to add a ControlUp Script action – “FSLogix – Logoff sessions with loaded profiles”
Here’s how to put the automation together:
When FSLogix fails to attach a container, it logs an Event ID 51 in the Microsoft-FSLogix-Apps/Operational event log. This event includes vital information:
An event viewer task will detect when this event is generated and run the ControlUpFSLogixEventGenerator.ps1 script, writing a new event to the System log with Source set to ControlUp-FSLogixProfileLocked and Event ID 999.
This event source, ControlUp-FSLogixProfileLocked, and ID, 999, is the signal ControlUp watches for.
To automate this process of creating the event that ControlUp can detect, a convenience script can be run to create an event-triggered scheduled task on your golden image or individually on each session host:
In this example, I’m storing the ControlUpFSLogixEventGenerator.ps1 on the C:\Scripts folder on each machine.
Run the “CreateEventLogTask.ps1” script with the parameter “ScriptPath” and put the full path to the “ControlUpFSLogixEventGenerator.ps1” script.
Example:
. “C:\Users\amttye\Downloads\FSLogix_LogOffSupportFiles\CreateEventLogTask.ps1” -ScriptPath “C:\Scripts\ControlUpFSLogixEventGenerator.ps1”
This is the result of a successful run of the event-triggered scheduled task creation script:
You can review the created task in Task Scheduler:
Now that the failure information has been collected and the connection to ControlUp has been configured, it’s time to set up the correction action.
In the ControlUp for VDI console, we’ll import the Script Action that will do the corrective action and the trigger to connect the action to the event. Some configuration will need to be done for both the script action and trigger to tailor them to each environment.
Script Action
To import the script action, open the ControlUp Management Console and click on “Script Actions.”
Click “Add Script.”
The script action needs to run under a service account that can query the ControlUp objects and run the script action. Click on “Organizational Scripts,” then select “FSLogix – Logoff sessions with loaded profiles,” and click “Modify”.
Within the “Modify script-action parameters,” set the “Shared credentials” to one of the shared credential accounts within ControlUp, which has rights to see the machine and session resources and run the script action.
Click “OK” then “Finalize” and run through the Finalize wizard for the script action. Close the Script Management Window.
Trigger
In the ControlUp Management Console, click “Triggers” then “Import.”
Select the “FSLogix – Profile in use.json” file and click “Open.”
If you’re prompted that a schedule name already exists, click “OK” to continue.
Click “Apply”.
Find the new Trigger called “AAE_FSLogix – Log off users with profiles in-use” and select it, and click “Edit.”
Click Next through the wizard until you get to the Scope, where you can select the machines you want to monitor for stuck profiles.
Click “Next” then “Finish”.
Click “OK” to close the “Settings” window.
Now, when a user attempts to connect to a new session and FSLogix fails to mount their container, ControlUp:
This process reduces user wait time from minutes or hours to seconds and eliminates helpdesk tickets for this common issue.
The impact of this solution is immediate and significant:
ControlUp provides a robust, integrated automation solution that can collect, connect and correct, making it easier for businesses to achieve their goals and thrive in the evolving digital landscape.
Ready to reduce your help desk tickets and user wait time experience? Schedule a demo today to learn more.