I was thinking of writing a script to help mitigate this issue.
It would be configured as a "task scheduled" script on Citrix VDA machines, and would follow the following steps.
- Iterate over current online/disconnected users on the VDA machine and store them into an array.
- Compare current online/disconnected user's profiles created under C:\Users against users in that array, if any exist that aren't actually online we know they are broken.
- After determining which users are broken, we can dismount their VHDX, and use handle to close any open files/folders, and delete the user profiles still left behind.
I'm not sure how practical this is, but if Microsoft isn't going to be looking at fixing this issue anytime soon, it's time we either look for an alternative solution or try and put measures in place to mitigate this?
Does anyone see any potential reasons why a script of this nature wouldn't work?