Hello everybody,
I use Powershell and SQL to query the current search index status with the following code (found on the Internet).
$sql = "SELECT System.ItemName, System.DateCreated FROM SYSTEMINDEX"
$provider = "provider=search.collatordso;extended properties=’application=windows’;"
$connector = new-object system.data.oledb.oledbdataadapter -argument $sql, $provider
$dataset = new-object system.data.dataset
$index = if ($connector.fill($dataset)) { $dataset.tables[0] }
$Anzahl = ($index | measure).count
This works quite well for a while, but at some point when the number of files that are indexed gets too large, I get the following error.
Exception calling "Fill" with "1" argument(s): "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)."
At C:\ProgramData\checkmk\agent\local\check_index_status.ps1:5 char:14
+ $index = if ($connector.fill($dataset)) { $dataset.tables[0] }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : OleDbException
Is there any way to work around this? Unfortunately, I don't know enough about it myself.
Bye, Ikkarus13