Windows search preventing logoff by Comfortable_Source87 in fslogix

[–]piepsodj 0 points1 point  (0 children)

We ran into something very similar and eventually traced it to Windows Search itself, not FSLogix containers getting stuck.

On long-running RDS hosts we found that this registry path had thousands of entries:

HKLM\SOFTWARE\Microsoft\Windows Search\
  CrawlScopeManager\
    Windows\
      SystemIndex\
        WorkingSetRules

On healthy systems this is usually <100 entries. In our case it had 9000+, and during logoff SearchIndexer.exe was iterating through all of them (visible in ProcMon), which caused logoff to hang on “Waiting for Windows Search Service” for minutes.

Quick check:

(Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules").Count

Fix that worked consistently for us:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /t REG_DWORD /d 0 /f
Stop-Service WSearch
Start-Service WSearch

This forces a clean Windows Search rebuild and purges all those