The following procedure lists these steps to remove a server application:
To remove a server application
Present a dialog box that lets the administrator select an application to remove. The ShowChooseServiceDlg function displays this type of dialog box.
Determine whether the application's service is running by calling the FServiceRunning function. If it is running, attempt to stop the service.
Remove the directory object. Call the HrRemoveGateway function to remove a gateway object and the HrRemoveMailboxAgent function to remove a mailbox agent from a given site. Both functions are defined in EXCHINST.C.
Remove performance monitoring for the service by calling the HrRemoveServicePerfMon function. If the lpfUnloadCounters parameter returned from this function call is TRUE, continue with step 5. If it is FALSE, multiple instances of the application are installed. In this case, perform steps 7 and 8, and then begin again at step 1.
Call the FUnloadCounters function to unload the counters used in performance monitoring.
Remove the service from service control manager of Windows NT. Do this by calling the HrRemoveService function.
Delete the files belonging to the service using the EDKDeleteNode function.
The DoRemove function removes components from the local computer. Server components in the Microsoft Exchange Server directory must be removed in a separate step using directory access functions. For example, address types and Administrator extensions are not removed because they may be needed by other applications.