Solved

Scripting with Windows Desktop Search

Posted on 2014-01-02
7
349 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
ID: 39752608
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
ID: 39752701
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
ID: 39753141
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:jb-smith
ID: 39754480
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
ID: 39755604
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
ID: 39766850
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
ID: 39825208
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

860 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