Scott Forsyth's WebLog

Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.

April 2008 - Posts

Enabling XP and Windows Server 2003 to Search All Files Types

Searching for file content on your computer or server is a common task and one where you would expect accurate results.  You, like so many of us, may have assumed that but found different results.

Within Windows 2000 Server, if you entered something in the windows search dialog and clicked "Find", it would find it.  But, with Windows Server 2003 or Windows XP, there are a lot of searches that would come up empty, even if you were sure that you had files with the words in them that you were searching for.

The reason that the results are different in Windows Server 2003 and Windows XP is because Microsoft decided to only include certain types of files in the search to speed up the search.  Even if you set the file type as "All Files and Folders", it ignores a large amount of files when doing a search.  The reasoning is that it takes a long time to search every file on the server and binary type files like a jpg or gif or exe don't need to be searched for a plain text search term.  Why include them if they aren’t going to turn up any results anyway.

While I agree with it in part, if I want to find a file based on a keyword, I want it to search every file so that I can be sure that my search is accurate.

The fix is fairly easy as long as you don't mind making a registry change. My preferred method is to set Windows to index every file, even if it's an unknown exception.  This is done by adding or changing a DWORD called FilterFilesWithUnknownExtensions in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex.  Set it to 1. (1 for on, 0 for off)

In fact I added it as part of the build process here at ORCS Web when Windows Server 2003 first came out a few years ago.  The search on every server on our network will search every file type.

Here is how I prefer to do it.  Create a file called AddIndexingToAllFiles.reg (Or, I just call it abc.reg since I delete the file immediately after using it).  Then put the following in it:

Windows Registry Editor Version 5.00

  [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex]

"FilterFilesWithUnknownExtensions"=dword:00000001

Save the file on your desktop and double click on it.  After accepting the prompt and warning, the entry will be added to your registry.  You can delete the registry file since you're done applying it.

Here's a good Microsoft KB article on this with further details: http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173.  It also explains how you can add specific extensions rather than just indexing all files if you prefer to do that.

Note: This is for Windows XP and Windows Server 2003.  The rules change again in Vista with a whole new search engine and method.  Here is a long discussion between Microsoft and some not-so-happy people discussing how Vista works: http://windowsvistablog.com/blogs/windowsvista/pages/advanced-search-techniques.aspx.

tsadmin command change in Windows Server 2008

I use Remote Desktop all the time to manage servers remotely, and often I join other people's sessions to troubleshoot something with them, or walk through something or other.

In Windows Server 2003 (and Windows 2000 Server), the easy way to start up Terminal Services Manager is Start -> Run -> 'tsadmin' -> [Enter].  This calls us Terminal Services Manager where I can right-click on a user and click 'Remote Control', and if they approve, I can join their session.

This doesn't work in Windows Server 2008 anymore.  The change is ever so slight.  In Windows Server 2003 the tool was tsadmin.exe, so typing 'tsadmin' was all that was required to start the tool.  Now, in Windows Server 2008, this has been moved to a MMC snap-in and is called tsadmin.msc (plus tsadmin.dll is used silently).

So, to spin up Terminal Services Manager in Windows Server 2003, you can click on Start and your cursor focus will already be in the search box.  Type 'tsadmin.msc' and press [Enter] and you'll be in Terminal Services Manager.

If you really don't want to type the '.msc' each time, you could create a batch file to do it for you.  Create a file in c:\windows\system32 (which is in the system path already), call it tsadmin.bat and type 'tsadmin.msc' (without the quotes) in the body of the file.  Save it and you'll be set.  The disadvantage of doing this though is that you won't be practiced up on typing tsadmin.msc on fresh servers, so personally I prefer to just remember the extra .msc now on Windows Server 2008.

Note: If you don't type this often enough to remember 'tsadmin.msc', this has always been available from the Administrative Tools folder.  In Windows Server 2003/2000 it's directly under Administrative Tools.  In Windows Server 2008 it's one folder deeper under 'Terminal Services'.

 

Posted: Apr 03 2008, 09:18 AM by OWScott | with 1 comment(s)
Filed under:
More Posts