How to programatically update security cache?
In coveo for sitecore, is there a way to trigger security cache update when a new user account is created? I have already defined a schedule (every 5 mins) but am wondering if it can be done through code.
The best way to affect the service through code is using the Admin Service. If you are using Coveo for Sitecore, then the Admin Service is already installed on your CES machine, you can access the service through port 80, or 443 if you secured it.
Add the ?wsdl extension to see the list of functions available.
This said, I am not helping your case since Security cache update is not one of them! But now you know :P
There is already an idea to add it, you can go and vote for it.
Oh, but you need it now right?
Here is a workaround for now, create a vbs file and paste the following:
Option Explicit Dim Admin: Set Admin = GetAdmin() Admin.UpdateFileSecurityCache(true) Function GetAdmin() Set GetAdmin = CreateObject("CESAdmin.Admin.7.0") Call GetAdmin.Connect("localhost", "default") Call GetAdmin.Refresh() End Function
Simply call this script through code and the cache will refresh.