Last active
October 31, 2021 20:27
-
-
Save SvenAelterman/3b767320cd535e06ea33b3398b4e39c9 to your computer and use it in GitHub Desktop.
PowerShell to query local Windows Search index (e.g., for Visio shapes)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$contents = "Virtual" | |
$sql = "SELECT System.ItemName, System.ItemUrl FROM SYSTEMINDEX WHERE Contains(*,'$($contents)') AND System.ItemType='.VSSX'" | |
$Provider = "Provider=Search.CollatorDSO;Extended Properties=’Application=Windows’;" | |
$adapter = new-object system.data.oledb.oleDBDataadapter -argument $sql, $Provider | |
$ds = new-object system.data.dataset | |
if ($adapter.Fill($ds)) { $ds.Tables[0] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment