FsLogix - Unclean logoff causing locked files until server reboot

Much R 101 Reputation points
2021-01-13T16:29:50.18+00:00

Problem is described by M4deman under unclean-logoff-causing-locked-files-until-server-reboot

It seems to have something to do with the 2009 version.
The latest version of FSLogix is installed whats-new

Description

After a user logoff, the "System" Process (PID 4) locks the following folders:

C:\Users\local_username\AppData\Local\Microsoft\Credentials
C:\Users\local_username\AppData\Roaming\Microsoft\Credentials

The user is completely logged of, according to Task Manager.

In the FSLogix Profile Log file I can see the following:

[07:53:55.601][tid:00000c90.0000ce44][ERROR:00000020] Delete profile failed for sid S-1-5-21-3364776539-3721753400-1968955100-1179, Cleaning up manually. (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.)
The last sentence means that the process cannot access the file, because another process already uses it.

Also the whole "local_username" folder cannot be deleted:

[08:23:15.479][tid:00000c90.0000bcc4][WARN: 00000005] Failed to delete C:\Users\local_usename (Access is denied)
Access Denied

Does someone have any info on this behaviour?

Windows for business | Windows Client for IT Pros | User experience | Remote desktop services and terminal services
Windows for business | Windows Client for IT Pros | User experience | FSLogix

107 answers

Sort by: Most helpful
  1. hyperv117 10 Reputation points
    2023-09-13T17:39:25.6966667+00:00

    We've mitigated our fslogix issues by restarting our RDS servers once a week. It's a pain but ever since we introduced this cadence we haven't had the odd server lockups we used to get.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  2. Martijn Kools 171 Reputation points
    2022-12-13T10:10:19.323+00:00

    Not sure if it helps anyone, but for two customers I have excluded the c:\windows\system32\lsass.exe process from Microsoft Defender (process exclusion in Defender GPO). This is the process keeping the credentials folder locked.

    And it seems like the issue is gone. 9 days already without issues and every single profile is being deleted at logoff. No local_ directories that are left behind. No more black screens on login or stuck VHDX files. One environment is rebooted only one time each week and showed no more issues at all so I'm a happy camper for now, until the next issue.

    This may not help everyone as I am sure there's more than one issue.

    Was this answer helpful?

    2 people found this answer helpful.

  3. Андрей Михалевский 3,476 Reputation points
    2021-10-20T09:55:31.237+00:00

    As a temporary solution, I use this script when a user logs out using group policies.

    $SID = ([System.Security.Principal.WindowsIdentity]::GetCurrent()).User.Value
    
    Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileService\References\$SID" -Name RefCount -Value ([byte[]](0x00,0x00,0x00,0x00))
    

    Was this answer helpful?

    2 people found this answer helpful.

  4. Андрей Михалевский 3,476 Reputation points
    2021-09-10T06:18:40.043+00:00

    I can't understand why the developers are ignoring this problem. Even LeilaKong doesn't give answers now. What is wrong with them ?

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  5. Much R 101 Reputation points
    2021-01-15T07:54:01.613+00:00

    Am I the only one in the world who has the problem?

    Thanks
    Regarts
    Michael

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.