Unregister the Web Filter from the Command Line

If you want to remove a Web filter, in addition to deleting the dynamic-link library (DLL), you need to unregister the Web filter in the containing array in the stored Forefront TMG configuration. This is accomplished in the hierarchy of Forefront TMG administration COM objects by removing the FPCWebFilter object that represents the Web filter from the FPCWebFilters collection accessed through the WebFilters property of the FPCExtensions object for the array. To launch this process and unregister the Web Response Modifier filter, enter the following at a command prompt (from the folder where Webresponsemodifier.dll resides):

regsvr32 -u Webresponsemodifier.dll

This command is carried out by the code in the implementation of the DllUnregisterServer function in the Web Response Modifier sample. This function is exported by the DLL by including its name among the names of the functions to be exported in the .def file. The code from the Web Response Modifier Web filter sample is shown as follows.

// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
	HRESULT hr = RegisterWebFilter(false);
	return hr;

The RegisterWebFilter function called in this implementation of DllUnregisterServer does the actual work. This function is described in detail in Add the Web Filter to Forefront TMG.

Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.