DCOM Configuration

FDN » COM/DCOM » DCOM Configuration

DCOM Configuration

DCOM (Distributed COM) extends COM to allow objects to be created and accessed across the network. A client on Machine A can create and call methods on a COM object running on Machine B.

How DCOM Works

  1. The client calls CoCreateInstanceEx with the remote server name.
  2. COM contacts the SCM (Service Control Manager) on the remote machine via RPC.
  3. The remote SCM launches the COM server process and creates the object.
  4. A proxy is created on the client and a stub on the server. All method calls are marshaled via RPC.

Configuring DCOM with dcomcnfg

  1. Run dcomcnfg from the Start → Run menu.
  2. Navigate to Component ServicesComputersMy ComputerDCOM Config.
  3. Find your COM component in the list.
  4. Right-click → Properties.

Key Configuration Tabs

TabSettings
GeneralAuthentication level (None, Connect, Call, Packet, Packet Integrity, Packet Privacy)
LocationRun on this computer, or specify a remote computer
SecurityLaunch Permissions, Access Permissions, Configuration Permissions
IdentityThe account under which the COM server runs: Interactive User, Launching User, or a specific account

Creating a Remote Object from VBScript

' Create a COM object on a remote server
Set obj = CreateObject("FlameNetUtils.StringHelper", "APPSERVER01")
WScript.Echo obj.Slugify("DCOM Test")
Set obj = Nothing

Firewall Ports

DCOM uses RPC, which requires the following ports:

  • TCP 135: RPC Endpoint Mapper (always required)
  • TCP 1024-65535: Dynamic RPC ports (configurable via registry to a narrower range)

To restrict the dynamic port range:

REM Set RPC dynamic port range to 5000-5100
reg add "HKLM\Software\Microsoft\Rpc\Internet" /v Ports /t REG_MULTI_SZ /d "5000-5100"
reg add "HKLM\Software\Microsoft\Rpc\Internet" /v PortsInternetAvailable /t REG_SZ /d "Y"
reg add "HKLM\Software\Microsoft\Rpc\Internet" /v UseInternetPorts /t REG_SZ /d "Y"

Security Best Practices

  • Set authentication level to at least Packet Integrity for sensitive data
  • Use Packet Privacy (encryption) if data crosses untrusted networks
  • Run COM servers under a dedicated service account, not Interactive User
  • Grant only required accounts Launch and Access permissions
« Developer Network ‹ Creating COM Components in VB COM Automation with VBScript ›