Matt Hester Windows Administration

Find Anything with Windows Desktop Search Have you ever wondered why it takes 3.2 seconds to search the Internet but 2.7 days to search your hard drive? Don’t you wish you could search your hard drive and e- as quickly as the Internet? You can with the newly improved Windows Desktop Search (WDS). Think about how much information you have stored on your computer, and where that ware versions). For a full list see search.. information resides. Now think about all the information your users have stored on their com/docs/toolbar.aspx?t=MSNTbar_CONC_Searchable­ laptops, desktops, or on the network. I have all my rarely used information on my d:\ drive FileTypes.htm. And, with an extensible API set, or a network share, my somewhat important information in My Documents, and my really WDS can index anything, anywhere. WDS vital information on the desktop and in the tons of e-mail that has built up over the years. is available to all users in their and (Not to mention the millions of other Outlook items stored in contacts, and tasks.) it runs automatically whenever the user logs Finding anything in that morass is quite a chore. And not just for me. IDC conducted a into the machine. Figure 1 shows some typical survey that showed the average active computer user spends nine and a half hours a week search results. Built-in right-click capabili- looking for documents, which illustrates the ties allow you to copy, move, delete, print, • Types of files indexed by WDS serious need for a better solution. So how open, reply, forward and even preview your • How the WDS index is maintained can WDS help? search results (see Figure 2). • Deployment tips Windows Desktop Search is an extremely Windows Desktop Search also provides • Management and powerful search engine that lets you search great flexibility to multinational organi- through all of those pockets of information: sations. The optional Multilanguage User Matt Hester is a seasoned TechNet presenter, an Exchange insider who worked as an MCT for over eight years before joining your hard drives, your network drives (via Interface (MUI) pack download offers sup-

AT A GLANCEAT Microsoft. Matt loves reaching out to users and customers in the UNC names) and even your e-mail. WDS port for 30 languages in addition to English local community and gets a thrill from installing a server that can can index more than 200 unique file types (see Figure 3). send e-mail or provide other services. (more than 350 if you count different soft- If you tried the initial versions of WDS, 26 To get your FREE copy of TechNet Magazine subscribe at: www.microsoft.com/uk/technetmagazine Figure 1 Broad Range of Search Results Figure 2 Previewing Files you may have been deterred by the perfor- and search your e-mail, you need Outlook recommended for the index. The size of the mance hit you took during indexing. The 2000 or 6.0 or greater. For index depends on how much content you new version of WDS has significant im- full preview of Office documents you need have and how much you index. And for best provements, though. WDS 2.6.5 reduces Office XP or later. viewing, a 1024 x 768 screen resolution is disk access by 50 percent compared with From a hardware perspective, you need recommended. previous versions, and it eliminates the de- at least a Pentium 500MHz processor or lay during system shutdown. WDS 2.6.5 of- better (1GHz recommended), 128MB of Deployment fers three new policies (including policies RAM (256MB recommended, 512MB is WDS is easy to deploy into any environ- for inclusions/exclusions of specific paths), optimal), and 500MB of hard disk space is ment. It comes as a self-extracting executable considerable improvements in stability and file of only 4.5MB, so you can use Systems results, and full integration in the Windows Figure 3 Supported Languages Management Server (SMS) to deploy it or servicing model. There are also add-ins for you can turn to Group Policy. The size of Lotus Notes and for the MSG ● Bulgarian ● Korean the program makes it ideal for Group Policy so WDS can index Outlook MSG files that ● Chinese (Simplified) ● Latvian package deployment. However, in order to have been saved outside of Outlook. Content ● Chinese (Traditional) ● Lithuanian use Group Policy for deployment, note that within e-mail attachments are indexed and ● Croatian ● Norwegian you will first need to wrap the WDS file in searched as well. ● Czech ● Polish an .msi file. If you have multiple or dual-core pro- ● Danish ● Portuguese WDS is distributed like other Windows cessors, look for enhanced performance (Brazilian) components through the package install- and even less noticeable system impact as ● Dutch ● Portuguese er (formerly update.exe), which means it the thread-optimised search engine code (Iberian) can also be distributed very easily using a takes advantage of the additional process- ● English ● Romanian script. WDS supports both attended and ing threads. ● Estonian ● Russian unattended installation modes. Attended ● Finnish ● Slovakian mode, which requires end user interaction, Configuration Requirements ● French ● Slovenian is more common. To take advantage of WDS you must ● German ● Spanish For unattended installations you can cre- be running Windows XP SP1 or higher, ● Greek ● Swedish ate custom batch files using the command- Windows Server 2003, or Windows 2000 ● Hungarian ● Thai line options that are shown in Figure 4, or SP4. As of now only the 32-bit versions ● Italian ● Turkish by using SMS, Group Policy, or Windows are supported; support for 64-bit systems Update Services. ● Japanese is expected in the near future. To index The command line offers many options for TechNet Magazine October 2006 27 Windows Administration

host for IFilter add-ins, which enable the Figure 4 Installation Command-Line Options WDS indexer to open, read and index the Command-Line contents of new file types it would not oth- Option Description erwise be able to fully index. Many software /quiet or /q Provides no status dialog box during the extraction. Can be used programs on your PC already have IFilters in combination with /extract or /extract path, or this option will di­ installed. For example, if you use Microsoft rect the installation to run in quiet mode. Office Visio®, you automatically have the /passive or /U Provides a progress bar during the extraction, but does not prompt Visio IFilter plug-ins installed. Several free you for the destination folder name. Can be used in combination IFilters are available (StarOffice/OpenOffice, with /extract or /extract:path, or it will direct the installation to run in passive mode. PDF, ZIP, and so on) and are located at add­ ins.msn.com/addins_category_desktop.aspx. What’s /extract or /X Extracts package files without starting the installation. Prompts you for the path of the destination folder for extraction. When great about IFilters is the extensibility they used in conjunction with the /q or /U switch, extracts the package provide. WDS provides the architecture that file to a randomly named folder on the root folder. lets you or your developers write customised /extract:path_name Extracts software update package files to the specified folder IFilters. Windows Desktop Search is smart or /X:path_name without starting the package installer or prompting you for a des­ enough to recognise new IFilter plug-ins tination folder. When used in conjunction with the /q or /U switch, and will be able to index the contents of extracts the package file to the specified folder. the associated file types the next time the index is rebuilt. Moreover, WindowsSearch­ automated installation. When you use the /q ed to look into other drives and directories Filter.exe was specifically designed to survive option, for example, the WDS installation is on your system including network drives poorly written third-party IFilters, in order completely silent, and if a restart is required, via UNC paths. to maintain overall reliability. it occurs automatically. Alternatively you can use the /passive or /U option, which displays WDS Components Once WDS is a progress bar and warns that a restart will WDS consists of four elements: Win­ deployed, it will occur if necessary. Passive mode also dis- dowsSearch.exe, WindowsSafeFilter.exe, plays any errors that may be encountered. WindowsSearchIndexer.exe and Windows­ create and maintain Figure 4 details the command-line options SearchFilter.exe. WindowsSearch.exe is the an individual index and their functions. primary component. It runs automatically After extraction, the files are placed in at computer startup and is located in the of all the the specified folder. If no folder is speci- Startup Program Folder. It manages the in- information on fied and the /extract option was used with dexer process and provides the management /passive or /quiet, a randomly named folder interface via the desktop tray. Additionally, it a user’s PC. (like 1ed6b742f546f) is generated and the defaults to replacing the standard Windows The final component, WindowsSearch­ setup files are placed there. When installa- search GUI (Search Companion) with the Indexer.exe, is the chief process for creating tion is finished, the folder and installation enhanced search interface. and querying the WDS index. This process files are removed. The WindowsSafeFilter.exe processes the runs per user, which ensures it indexes the Figure 5 provides examples of commands information before it gets into the index documents in the user’s security context. In you can use to extract the contents of a soft- and maintains the integrity of the index. future releases the indexer is expected to be- ware update package. WindowsSafeFilter.exe is the guardian of the come a system service where it will maintain Once WDS is deployed, it will create and WDS index, preventing attacks against it. It the high level of security WDS currently of- maintain an individual index of all the infor- is the component responsible for a number fers. WindowsSearchIndexer.exe stores the mation on a user’s PC as well as any calendar of security tasks. index by default at: %UserProfile%\Local appointments, contacts, tasks and e-mails WindowsSearchFilter.exe is critical for Settings\Application Data\Microsoft\ in Outlook. Each user maintains his own the extensibility of WDS. It provides the Desktop Search. index and finds items only within his own scope on the system. The index also contains metadata for an item including the time a Figure 5 Extraction Commands file was created, location, owner, file type, and so on. By default, WDS will index just Example Description the contents of the My Documents folder wds-x86-xx.exe /q /x:C:\WDS Extracts and installs the contents of the package to a and the default e-mail location (stored ei- newly created folder called WDS on drive C. ther locally in a .pst or .ost file or on the wds-x86-xx.exe /extract /passive Extracts the contents of the package to a randomly generated folder in the root folder of the current drive. Exchange Server). Indexing can be expand- 28 To get your FREE copy of TechNet Magazine subscribe at: www.microsoft.com/uk/technetmagazine Windows Administration

to produce a resultset. Let’s say you’re looking for the word “phaser.” If there are multiple words or wildcards in the search query, the inverted index will cross-reference the in- dex to return accurate results. The inverted index might return a result something like Figure 7. Then the WDS engine would ref- erence the properties database to display results like those in Figure 8. The shadow indexes along with the main inverted index keep the most current in- dex. For example, if the word phaser gets changed in a document, the shadow in- dex will keep the resultset up to date (see Figure 9). Over time the shadow indexes are merged into the main inverted index to re- flect all changes. What happens under the covers when the initial indexing process begins and WDS needs to create the first index? During de- Figure 6 Desktop Search Directory ployment, the process will determine when The Index The properties cache database (RS­ the documents were last modified and when The index is stored in the \Local Settings\ App.edb) is crucial in processing the search (if ever) WDS last crawled them. If the pro- Application Data\Microsoft\Desktop Search results. RSApp.edb holds all the extra prop- cess determines an index doesn’t exist, then directory structure of the user’s profile erties concerning the documents—typical- the indexer begins to crawl the document (Figure 6), which looks rather complex. ly path, owner, type and the like—and will directory structures (directory tree, e-mail Two main components make up the WDS work with the inverted index to return a full folder tree, and so on). index: an inverted index and a properties resultset. RSApp.edb provides the necessary After deployment, the behaviour is some- cache database. properties to open the document, preview what different. When the documents on the The inverted index is actually an index it, group the documents, sort the results, system change, a notification will of words in your documents and it includes and display them. trigger and send the changed document up to 120 additional properties, though the Here is a simplified example that illus- straight into the process. These updates typical document (any file that’s indexed) trates how the two databases work together are prioritised and sent to the beginning of will only have about 10 properties. The the indexing process, so if the WDS is do- inverted index portion of WDS is made ing other work, these changes are sent to the up of several files located in the desktop Figure 7 Inverted Index front of the line to be processed. search directory. The .ci and .dir files are Locations in The way WDS indexes the documents is located in %UserProfile%\Local Settings\ Word Document Document similar in both of these processes. The doc- Application Data\Microsoft\Desktop phaser 52 4,8,15,16,23,42 ument to be indexed is sent to a protocol Search\Applications\RSApp\Projects\ 55 5,135,222 handler which turns it into a stream of data. MyIndex\Build\Indexer\CiFiles. The main The stream is then sent to the appropriate index file will be the largest file in the di- IFilter for parsing. When the document has rectory; the other files are referred to as Figure 8 Properties Cache been parsed, the appropriate information shadow indexes. is then distributed to the inverted index or Document Location Type properties cache. Keeping the Index in Sync 52 C:\docs .doc What all this updating means is that you One of the challenges of maintaining a should never have to rebuild the index. There searchable index is making sure it produc- is a specific policy you can implement to es accurate results even when documents Figure 9 Shadow Index prevent your users from rebuilding the in- change (moved, deleted, altered, and so dex on their own. Locations in forth). In this structure the database must Word Document Document In addition to updating the indexes as be updated in order to reflect any changes, phaser 52 4,8,15,16,23,42 you make changes on your PC, WDS pre- and this is where the multiple shadow in- serves performance during busy periods 55 5,222 dexes come into play. using a smart back-off mechanism that TechNet Magazine October 2006 29 Windows Administration

sation’s business needs. There are more than two dozen different settings that provide the flexibility to control your WDS installation. The three main areas you can manage with Group Policy are setup, index and search. These settings not only allow you to man- age WDS, but also enhance its functionality. In the search section, Add Primary Intranet Search Location and Add Secondary Intranet Search Location allow your users to push their search queries to your intranet search providers, such as SharePoint Portal Server or SharePoint Services. If you use either the /quiet or /passive switches for unattended install mode, you Figure 10 Group Policy Settings should enable the “prevent first run custom- forces WDS to wait until CPU load drops attachment formats (such as a ZIP or macro isation wizard” setting, which keeps users before resuming indexing. This back-off file) by default. This is accomplished with from seeing the first run wizard. A major- functionality is triggered automatically the WindowsSafeFilter.exe mentioned ear- ity of the settings are located in the index when WDS sees increased usage in any of lier. You can prevent the indexing of at- section in GPO. These settings control what the following: I/O, keyboard or mouse, or tachments altogether using a Group Policy will be in the index and where WDS will look CPU. In other words, WDS works efficiently setting called Prevent Indexing of E-Mail for the documents (see Figure 10). without consuming excess system resources while other higher priority tasks are run- WDS is designed to index e-mail attachments ning. For laptops, WDS can be configured to prevent indexing while the computer is in a sandbox and prevent the previewing of running on battery power. complex attachment formats by default. Security Attachments. WDS stores the index in a sim- WDS also offers a completely extensible WDS is designed with security in mind. plified encryption format. You can achieve API set that provides virtually limitless ca- It adheres to the Microsoft security and even more security by placing the index on pability to customise the search experience privacy model, so WDS does not index an NTFS volume and using the Encrypting to meet your needs. In addition to adding sensitive locations such as Web pages, tem- File System (EFS). your own IFilters, you can extend WDS so porary Internet files, the cache, and password it can index new data stores, such as the da- protected Office files. It is also designed Management tabase of an e-mail application. And WDS to index e-mail attachments in a sandbox WDS can be managed via Group Policy, so doesn’t stop at your local environment. and prevent the previewing of complex it’s easily customised to match your organi- With one click, it can take your users’ search to the Internet directly from the interface, For lots more on Windows Desktop Search, see the following sources: further integrating the silos of information Matt’s Blog: your users and your organisation need to blogs.technet.com/matthewms/default.aspx access effectively. Searching Tips: The WDS interface can also be made search.msn.com/docs/toolbar.aspx?t=MSNTbar_PROC_UseAdvancedSearchSyntax.htm more visible in your users’ environment. Windows Desktop Search Administration Guide: If you load the MSN® Search Toolbar suite microsoft.com/technet/prodtechnol/windows/search/dtsguide.mspx in combination with WDS, the search in- Desktop Search Add-ins: terface will show up in Microsoft Internet microsoft.com/windows/desktopsearch/downloads/default.mspx Explorer and Outlook, which makes it even and addins.msn.com/addins_category_desktop.aspx easier to use. MSN Toolbar: Why not give Windows Desktop Search addins.msn.com/addins_category_toolbar.aspx a try so you can finally unlock all those si- Windows Desktop Search SDK: los of information in your organisation and WDS Online Resources addins.msn.com/devguide.aspx truly integrate your data. To get started, Desktop IFilters on Channel 9: grab a copy at microsoft.com/windows/desktopsearch channel9.msdn.com/wiki/default.aspx/Channel9.DesktopSearchIFilters /downloads/default.mspx l 30 To get your FREE copy of TechNet Magazine subscribe at: www.microsoft.com/uk/technetmagazine