<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Media And Microcode : Windows Desktop Search</title><link>http://blogs.msdn.com/mediaandmicrocode/archive/tags/Windows+Desktop+Search/default.aspx</link><description>Tags: Windows Desktop Search</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Microcode: Getting DVR MetaData with Search-WindowsDesktop</title><link>http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-getting-dvr-metadata-with-search-windowsdesktop.aspx</link><pubDate>Mon, 14 Jul 2008 00:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8729859</guid><dc:creator>JamesBrundage</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mediaandmicrocode/comments/8729859.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mediaandmicrocode/commentrss.aspx?PostID=8729859</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx" mce_href="http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx"&gt;In the previous post&lt;/A&gt;, i explained that I was trying to find a way to get at the information about my TV shows, and introduced you to some of the thought process that went into finding out information about my DVR.&amp;nbsp; I then solved the most important portion of my DVR problem (extracting out the metadata) in a way that was flexible enough to apply to be used for other potential projects, like Getting Photo Metadata or Getting Contact Metadata.&lt;/P&gt;
&lt;P&gt;Here's the Search-WindowsDesktop function again:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function Search-WindowsDesktop($fields, $filter) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $connection = New-Object -comObject "ADODB.Connection" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet = New-Object -comObject "ADODB.RecordSet" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $connection.Open("Provider=Search.CollatorDSO;Extended Properties='Application=Windows';") &amp;gt; $null &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ofs = "," &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $query = "SELECT $fields" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $query += " FROM SYSTEMINDEX $filter" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $recordSet.Open($query, $connection) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($recordSet.EOF) { return } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet.MoveFirst() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (-not $recordSet.EOF) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = New-Object Object&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($field in $fields) { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result | Add-Member NoteProperty $field $recordSet.Fields.Item($field).Value &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet.MoveNext() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $recordSet.Close() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $connection.Close() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $connection = $null &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet = $null &lt;BR&gt;} &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I also introduced the way I think solve problems by looking at the smaller problems they contained.&amp;nbsp; My starting point was that I was trying to prune my Windows Media Center dvrms files.&amp;nbsp; I could have gone about getting rid of Windows Media Center files in a less elegant way, but I would have regretted it.&amp;nbsp; For instance, I could have pruned the files just on size, but I would have Lost &lt;EM&gt;Lost.&amp;nbsp; &lt;/EM&gt;But going down the path of getting metadata lets me do more related tasks.&lt;/P&gt;
&lt;P&gt;I strongly believe that whenever problem solving, it is key to examine not just the problems that you are working with, but to look at the related problems.&amp;nbsp; The root problem in this case was that dvrms files are my appetite for video on demand are both large enough to flood my disk.&amp;nbsp; If I pruned my collection on size, not only would I have lost &lt;EM&gt;Lost&lt;/EM&gt;, but I would only have the option of losing the files forever.&amp;nbsp; By getting the DVR metadata, I open up the door to a number of more promising paths:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I can back up certain shows to other hard drives&lt;/LI&gt;
&lt;LI&gt;If I can find a way to remove commercials&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;I can burn a DVD of the files&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;If I can find the right API,&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;I can convert the files to another file format&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;Getting the metadata solves the problem in a better and more flexible way than does chopping by file size.&amp;nbsp; &lt;A href="http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx" mce_href="http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx"&gt;Researching it&lt;/A&gt; also exposed me to other cool things that I can do, and give me a reference to use while creating my DVR Metadata script.&amp;nbsp; Using PowerShell, I tried running queries one by one for each of the properties on the &lt;A href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsprops.mspx#E6HAE" mce_href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsprops.mspx#E6HAE"&gt;Recorded TV&lt;/A&gt; reference to discover which ones work and determined if the return values were helpful.&lt;/P&gt;
&lt;P&gt;Here's the result of my efforts:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function Get-RecordedTV() { &lt;BR&gt;&amp;nbsp; Search-WindowsDesktop 'System.Title', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.EpisodeName', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.ChannelNumber', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.StationName', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.IsRepeatBroadcast', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.StationCallsign', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.ProgramDescription', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.IsSAP', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.IsHDContent', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.RecordingTime', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Video.FrameHeight', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Video.FrameWidth', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Video.EncodingBitrate', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Media.DateEncoded', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.ParentalRating', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Size', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.ItemURL', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.RecordedTV.RecordingTime' "WHERE System.RecordedTV.ChannelNumber IS NOT NULL" &lt;BR&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I know it really doesn't look like it, but that can be written as a one-liner.&amp;nbsp; By using an existing system and writing a generic function, I was able to write this Get-RecordedTV function simply by providing the data I needed to my Search-WindowsDesktop function.&lt;/P&gt;
&lt;P&gt;Since the Search-WindowsDesktop function returns objects with property names, it is possible to use a number of built-in PowerShell commands to help you look through the data.&lt;/P&gt;
&lt;P&gt;Here are the Cmdlets you can use to explore objects:&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=873 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=198&gt;Group-Object&lt;/TD&gt;
&lt;TD class="" vAlign=top width=673&gt;Creates groups of objects on a type or expression&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=198&gt;Select-Object&lt;/TD&gt;
&lt;TD class="" vAlign=top width=673&gt;Selects properties from an object or make new ones on the fly &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=198&gt;Sort-Object&lt;/TD&gt;
&lt;TD class="" vAlign=top width=673&gt;Sort a list of objects by a property&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=198&gt;Where-Object (or ?)&lt;/TD&gt;
&lt;TD class="" vAlign=top width=673&gt;Filters the objects by an expresson&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=198&gt;Foreach-Object (or %)&lt;/TD&gt;
&lt;TD class="" vAlign=top width=673&gt;Performs an action on each of the input objects&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;One quick thing I can see this way is what TV station I watch the most:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-RecordedTV | Group-Object 'System.RecordedTV.StationCallSign' | Sort Count -Descending&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Another thing I can do with a simple change is group by Parental Rating instead&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-RecordedTV | Group-Object 'System.ParentalRating' | Sort Count -Descending&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And of course, I can sort on the size and the time recorded:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-RecordedTV | sort 'System.RecordedTV.RecordingTime' -descending&lt;/P&gt;
&lt;P&gt;Get-RecordedTV | sort 'System.Size' -descending&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now I have the potential to build a much more flexible TV pruning solution.&amp;nbsp; In a future post, I'll show how you can resolve the ItemURL to a real file and, finally, how to prune the files you don't want by any criteria you'd like.&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;James Brundage&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8729859" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Windows+Media+Center/default.aspx">Windows Media Center</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/MetaData/default.aspx">MetaData</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Windows+Desktop+Search/default.aspx">Windows Desktop Search</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Microcode/default.aspx">Microcode</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/DVR/default.aspx">DVR</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Get-RecordedTV/default.aspx">Get-RecordedTV</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Search-WindowsDesktop/default.aspx">Search-WindowsDesktop</category></item><item><title>Microcode: Windows PowerShell, Windows Desktop Search &amp; Problem Solving</title><link>http://blogs.msdn.com/mediaandmicrocode/archive/2008/07/13/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx</link><pubDate>Sun, 13 Jul 2008 23:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8729498</guid><dc:creator>JamesBrundage</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/mediaandmicrocode/comments/8729498.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mediaandmicrocode/commentrss.aspx?PostID=8729498</wfw:commentRss><description>&lt;P&gt;In the pursuit of my passion of media (specifically, trying to prune my DVR collection in a more flexible way than Windows Media Center), I started getting curious about how I could get the same kind of data that Windows Explorer has about some RecordedTV.&amp;nbsp; Since I could find it using the Search dialog in Windows, I thought that Windows Desktop Search should have some way to get at it as well.&amp;nbsp; After a number of searches, I ran across &lt;A href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan07/hey0105.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan07/hey0105.mspx"&gt;this&lt;/A&gt; little snippet from &lt;A href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx"&gt;Greg Stemp's "Hey, Scripting Guy!" column&lt;/A&gt;.&amp;nbsp; It walks through &lt;A href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx"&gt;how to extract out the DateTaken information from a JPEG&lt;/A&gt;.&amp;nbsp; This article provides valuable code snippets from VBScript that I used to create a Windows PowerShell function (Search-WindowsDesktop).&amp;nbsp; The article also contained a small link to a reference of &lt;A href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsprops.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsprops.mspx"&gt;almost every special query field that Windows Desktop Search provides&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;That reference is the backbone of a number of scripts that I will post about here, but, in the interests of keeping it simple, I will post the final scripts in a later post.&amp;nbsp; It's also an example of how I go about solving problems.&amp;nbsp; When faced with a problem, my passion for programming partitions the problem.&amp;nbsp; I break each problem into a smaller set of individual problems with independent solutions.&amp;nbsp; This has a number of side-effects:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Increases the possibility that I might have a or know about a solution to a problem similar to the smaller problem &lt;/LI&gt;
&lt;LI&gt;Forces the mind to think of independent solutions to parts, which helps you build a number of reusable components instead of one throw away script &lt;/LI&gt;
&lt;LI&gt;Allows me to search for the answers to the unsolved problems more flexibly &lt;/LI&gt;
&lt;LI&gt;Opens the possibility to finding better answers for the independent problems later on, which can improve the flow and performance of the entire system &lt;/LI&gt;
&lt;LI&gt;Exposes me to potential other problems I could solve at reduced cost &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In the case above, I broke the original problem into a few problems:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Where can I find RecordedTV Metadata? 
&lt;UL&gt;
&lt;LI&gt;Where can I find the most metadata? Answer: (Windows Desktop Search) &lt;/LI&gt;
&lt;LI&gt;How do I get at it from scripts? 
&lt;UL&gt;
&lt;LI&gt;Where do I usually find scripts? (Answer: &lt;A href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx"&gt;Technet&lt;/A&gt;) &lt;/LI&gt;
&lt;LI&gt;Is there a solution here for RecordedTV? (Answer: not that I can find) &lt;/LI&gt;
&lt;LI&gt;What other metadata could I look for? 
&lt;UL&gt;
&lt;LI&gt;Photos (Answer: &lt;A href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx"&gt;Seek and Ye Shall Find - Scripting Windows Desktop Search 3.0&lt;/A&gt;) &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;How can I display the data? (Answer: Tediously, or I can use Windows PowerShell, which will display the properties on the object for free) &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Since the example that I have searches for Photo Metadata, which might be fun to script, Instead of making a function that just gets my recorded TV, I'm going to make a function that can query Windows Desktop Search for any field that I want and can come back with data.&amp;nbsp; Then I will write a script to get out my DVR metadata, but I can always build more interesting stuff from this core component later.&amp;nbsp; By building many things that depend on this core script, and ensuring that they all continue to work, I can make a flexible solution that can be extended upon and improved later.&lt;/P&gt;
&lt;P&gt;Here's my function to pull data out of Windows Desktop Search:&lt;/P&gt;
&lt;P&gt;function Search-WindowsDesktop($fields, $filter) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $connection = New-Object -comObject "ADODB.Connection" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet = New-Object -comObject "ADODB.RecordSet" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $connection.Open("Provider=Search.CollatorDSO;Extended Properties='Application=Windows';") &amp;gt; $null &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ofs = "," &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $query = "SELECT $fields" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $query += " FROM SYSTEMINDEX $filter" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $recordSet.Open($query, $connection) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($recordSet.EOF) { return } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet.MoveFirst() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (-not $recordSet.EOF) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = New-Object Object &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($field in $fields) { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result | Add-Member NoteProperty $field $recordSet.Fields.Item($field).Value &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet.MoveNext() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $recordSet.Close() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $null = $connection.Close() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $connection = $null &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $recordSet = $null &lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Here's a a few quick samples of using it that I'll expand upon later:&lt;/P&gt;
&lt;P&gt;Search-WindowsDesktop "System.Title", "System.RecordedTV.EpisodeName" "WHERE System.RecordedTV.ChannelNumber IS NOT NULL"&lt;/P&gt;
&lt;P&gt;Search-WindowsDesktop "System.Contact.FullName" "WHERE System.Contact.FullName IS NOT NULL"&lt;/P&gt;
&lt;P&gt;Search-WindowsDesktop "System.Photo.CameraModel", "System.Photo.ProgramModeText", "System.Photo.OrientationText" "WHERE System.Photo.DateTaken IS NOT NULL"&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;James Brundage&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8729498" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Windows+Media+Center/default.aspx">Windows Media Center</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/MetaData/default.aspx">MetaData</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/TechNet/default.aspx">TechNet</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Windows+Desktop+Search/default.aspx">Windows Desktop Search</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Microcode/default.aspx">Microcode</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/DVR/default.aspx">DVR</category><category domain="http://blogs.msdn.com/mediaandmicrocode/archive/tags/Search-WindowsDesktop/default.aspx">Search-WindowsDesktop</category></item></channel></rss>