When disabling Connection Leasing and enabling LHC Local Host Cache feature the database does not get copied to the controllers.
The database copy starts and the file gets created in C:\Windows\ServiceProfiles\NetworkService but it gets deleted shortly.
The following error message shows up in Event Logs •505:
An import to the LocalDB failed;
Error message: “Security Identifier does not represent a Windows Account”
SID exists under Limit Visibility Section for application, So run PowerShell Scripts to avoid going through every single Application.
From Delivery Controller, open PowerShell
Asnp Citrix* Get-BrokerApplication | select applicationname, associated usernames -This should give you a list of application names.
Filter them by Application Name and Associated Usernames
Find the SID from above under the Associated UserNames Column, this may appear for a few applications.
From here, we’ll manually have to go to each Application that the SID is associated with and remove from the Limited Visibility section
You will probably see “Show this application to the entire Delivery Group” selected here and the SID listed in the Limit Visibility part.
Highlight the SID and click Remove. -Once we have removed this SID, run the command again to see if there are anymore SIDs
Get-BrokerApplication | select applicationname, associated usernames
Then enable the Local Host Cache again using Set-BrokerSite -LocalHostCacheEnabled $true -ConnectionLeasingEnabled $false
Restart Config Sync Service.
SID exists under Limit Visibility Section for the application.