Skip to content

Instantly share code, notes, and snippets.

@jkniiv
Created November 28, 2019 01:53
Show Gist options
  • Save jkniiv/b165628823fe218cdf40fc06e35af499 to your computer and use it in GitHub Desktop.
Save jkniiv/b165628823fe218cdf40fc06e35af499 to your computer and use it in GitHub Desktop.
Gets the URL/file that is currently being indexed by Windows Search via the ISearchCatalogManager::URLBeingIndexed() method
# Gets the URL that is currently being indexed by Windows Search via
# the ISearchCatalogManager::URLBeingIndexed() method.
# N.B. This needs to be called elevated, i.e. with admin privileges!
# Load the dll (easiest to be found here https://github.com/IntelliTect/PSToolbox/tree/master/Lib)
Add-Type -Path .\Microsoft.Search.Interop.dll
$searchManager = New-Object Microsoft.Search.Interop.CSearchManagerClass
$catalog = $searchManager.GetCatalog("SystemIndex")
Write-Host $catalog.URLBeingIndexed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment