• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

Scripting with Windows Desktop Search

Hello fellow scriptwriters,

I have been tasked with creating an automated search that will return file names of office documents containing a keyword, spread over hundreds of UNC paths.

I can return the list of files in each path (using powershell), but cannot find a way to script WDS to search within the office documents and return only the file names that contain the keyword.
0
jb-smith
Asked:
jb-smith
  • 4
  • 3
1 Solution
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Are you wanting to use PowerShell?
Do you have the list of UNC paths in a txt file?
You could use something like this:
$results = foreach($uncpath in (get-content .\uncpaths.txt)){code to return query}

Open in new window

0
 
jb-smithAuthor Commented:
I would prefer PowerShell.
I have a loop that extracts data from a spreadsheet and converts to readable UNC, that was the easy part.

I am having problems scanning within office documents (I guess only WDS can do this).

The only missing component is scriping WDS.
0
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jb-smithAuthor Commented:
Read through those same pages last week, but was holding out to see is there was some API call that would make everything easy. Something that accepted a string to search for and returned a string as the list of files found (metadata and all).
0
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Scripting Guys to the rescue! I took another look on the Interwebs and it looks like it's possible without WDS.
https://blogs.technet.com/b/heyscriptingguy/archive/2012/08/01/find-all-word-documents-that-contain-a-specific-phrase.aspx

You should be able to adapt that for Excel and PowerPoint too.

Still a bit of a paint and the search will probably take a long time to process but it should work.
0
 
jb-smithAuthor Commented:
Well! That changes EVERYTHING! Thanks!
Will read tonight, meeting tomorrow on the progress of this script.

No time constraint on the search so this may work out well.
0
 
jb-smithAuthor Commented:
OK! Based on what you posted, Jeremy, I was able to use Microsoft Interop to do everything I needed. Wow, its like a great weight was lifted from my shoulders.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now