How to rebuild Windows Search Index by using PowerShell?
<p>As we didn't find any solution to our ever growing Windows Search DBs (not even with Microsofts help) we decided to rebuild the DBs regularily by SCOM, when they hit a specific limit. This relates to Windows Server 2012 R2. </p>

<p>I therefor need a PowerShell script that calls the <a href="https://msdn.microsoft.com/en-us/library/bb266424(v=vs.85).aspx" rel="nofollow">Reset</a> or <a href="https://msdn.microsoft.com/en-us/library/bb266421(v=vs.85).aspx" rel="nofollow">Reindex</a> method belonging to the <a href="https://msdn.microsoft.com/en-us/library/bb266414(v=vs.85).aspx" rel="nofollow">ISearchCatalogManager</a> interface.</p>

<p>So far I came up with the following:</p>

<pre><code># Load DLL containing classes &amp; interfaces
Add-Type -path "C:\Temp\SearchIndex\Microsoft.Search.Interop.dll"

# Create new ISearchManager object 
$sm = New-Object Microsoft.Search.Interop.ISearchManager

# should return ISearchCatalogManager object 
$catalog = $sm.GetCatalog("SystemIndex")

# Call the method 
$catalog.Reindex()
</code></pre>

<p>This however throws the following exception:</p>

<pre class="lang-none prettyprint-override"><code>New-Object : A constructor was not found. Cannot find an appropriate constructor for type Microsoft.Search.Interop.ISearchManager.
At C:\Users\myuser\Desktop\test.ps1:8 char:6
+ $sm = New-Object Microsoft.Search.Interop.ISearchManager
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand
</code></pre>

<p>What am I doing wrong here?</p>