Solved

Scripting with Windows Desktop Search

Posted on 2014-01-02
7
345 Views
Last Modified: 2014-01-31
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
Comment
Question by:jb-smith
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:Jeremy Weisinger
Comment Utility
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
 

Author Comment

by:jb-smith
Comment Utility
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
 
LVL 18

Expert Comment

by:Jeremy Weisinger
Comment Utility
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:jb-smith
Comment Utility
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
 
LVL 18

Accepted Solution

by:
Jeremy Weisinger earned 500 total points
Comment Utility
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
 

Author Comment

by:jb-smith
Comment Utility
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
 

Author Closing Comment

by:jb-smith
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now