1、编写DCOM组件:
  假设我们想通过ASP页面来远程启动DNS服务,并且DNS服务器与Web服务器不为同一台机器。我们可以编写一个ActiveX DLL 来实现这个功能。 
  首先我们建立一个批处理文件StartDNS.bat,文件中写入:Net Start DNS。将文件保存在DNS服务器的一个目录下,例如C:\ManDNS\:
  其次我们编写 Dll 程序如下(VB编写): 
 Public
Function StartDNS() As Boolean 
 On Error GoTo ErrHandle 
 Dim strReturn strReturn =
Shell("C:\ManDNS\StartDNS.bat") 
 StartDNS = True 
 Exit Function
ErrHandle: StartDNS = False
 End Function 
 DLL 名称为 ManDNS
类名为 DNSClass 我们将此DLL保存在C:\ManDNS\下。 
 2、注册DCOM组件: 
  编写好DLL程序后,我们要将其注册到服务器上。 
  首先在DNS服务器上打开Microsoft Transaction Server, 点击Computers,再点击My Computer,选中Packages Installed ,单击鼠标右键,选中New 再单击Package。会弹出Package Wizard。选中空包,取名为ManDNS,确定完成。点开此包,选中Component,单击鼠标右键,选中New --->Component。点击Import Component That Are Already,在列表框中选中ManDNS.Dll。 
  然后在Web服务器上打开Microsoft Transaction Server, 点击Computers,点中Remote Computer,选中DNS服务器上的ManDNS Component,单击OK,将其加入Web服务器。