' Copyright (c) 2007 Microsoft Corporation. All rights reserved.
'
' THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK
' OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
' This is a filter registration script to configure Exchange Server 2007 to index 2007 Office attachments.
' The script generates a .reg file that adds the required registry keys.
Const ForWriting = 2
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject ("WSCript.shell")
Set Env = Shell.Environment("Process")
wscript.echo "Creating ExchangeFilterRegistration.reg in the current directory"
Set file = FSO.OpenTextFile("ExchangeFilterRegistration.reg", ForWriting, True)
commonFiles = Env("CommonProgramFiles")
commonFiles = Replace(commonFiles,"\","\")
officeFilterLocation = commonFiles & "\Microsoft Shared\Filters\offfiltx.dll"
onenoteFilterLocation = commonFiles & "\Microsoft Shared\Filters\ONIFilter.dll"
visioFilterLocation = commonFiles & "\Microsoft Shared\Filters\VISFilt.DLL"
docxGuid ="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
pptxGuid ="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
xlsxGuid ="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"
zipGuid ="{20E823C2-62F3-4638-96BD-90F4F6784EBC}"
xlsbGuid ="{312AB530-ECC9-496E-AE0E-C9E6C5392499}"
onenoteGuid ="{B8D12492-CE0F-40AD-83EA-099A03D493F1}"
vsdGuid ="{FAEA5B46-761B-400E-B53E-E805A97A543E}"
exchangeClsidKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\MSSearch\CLSID"
exchangeFilterKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\MSSearch\Filters"
file.WriteLine "Windows Registry Editor Version 5.00"
file.WriteLine
file.WriteLine "[" & exchangeClsidKey & "]"
file.WriteLine
OutputCLSIDKey exchangeClsidKey, docxGuid, officeFilterLocation
OutputCLSIDKey exchangeClsidKey, pptxGuid, officeFilterLocation
OutputCLSIDKey exchangeClsidKey, xlsxGuid, officeFilterLocation
OutputCLSIDKey exchangeClsidKey, zipGuid, officeFilterLocation
OutputCLSIDKey exchangeClsidKey, xlsbGuid, officeFilterLocation
OutputCLSIDKey exchangeClsidKey, onenoteGuid, onenoteFilterLocation
OutputCLSIDKey exchangeClsidKey, vsdGuid, visioFilterLocation
file.WriteLine "[" & exchangeFilterKey & "]"
file.WriteLine
OutputFilterKey exchangeFilterKey, "docm", docxGuid
OutputFilterKey exchangeFilterKey, "docx", docxGuid
OutputFilterKey exchangeFilterKey, "pptm", pptxGuid
OutputFilterKey exchangeFilterKey, "pptx", pptxGuid
OutputFilterKey exchangeFilterKey, "xlsm", xlsxGuid
OutputFilterKey exchangeFilterKey, "xlsx", xlsxGuid
OutputFilterKey exchangeFilterKey, "xlsb", xlsbGuid
OutputFilterKey exchangeFilterKey, "zip", zipGuid
OutputFilterKey exchangeFilterKey, "one", onenoteGuid
OutputFilterKey exchangeFilterKey, "vsd", vsdGuid
OutputFilterKey exchangeFilterKey, "vss", vsdGuid
OutputFilterKey exchangeFilterKey, "vst", vsdGuid
OutputFilterKey exchangeFilterKey, "vdx", vsdGuid
OutputFilterKey exchangeFilterKey, "vsx", vsdGuid
OutputFilterKey exchangeFilterKey, "vtx", vsdGuid
wscript.echo "Created ExchangeFilterRegistration.reg for this server."
wscript.echo "Run ExchangeFilterRegistration.reg to enable Exchange Search indexing of 2007 Office attachments."
wscript.echo "then run ""net stop msftesql-exchange"" followed by ""net start msexchangesearch """
Public Function OutputCLSIDKey(base,guid,location)
file.WriteLine "[" & base & "\" & guid & "]"
file.WriteLine "@=""" & location & """"
file.WriteLine
End Function
Public Function OutputFilterKey(base,extension,guid)
file.WriteLine "[" & base & "\." & extension & "]"
file.WriteLine "@=""" & guid & """"
file.WriteLine
End Function