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
- The client calls
CoCreateInstanceExwith the remote server name. - COM contacts the SCM (Service Control Manager) on the remote machine via RPC.
- The remote SCM launches the COM server process and creates the object.
- A proxy is created on the client and a stub on the server. All method calls are marshaled via RPC.
Configuring DCOM with dcomcnfg
- Run
dcomcnfgfrom the Start → Run menu. - Navigate to Component Services → Computers → My Computer → DCOM Config.
- Find your COM component in the list.
- Right-click → Properties.
Key Configuration Tabs
| Tab | Settings |
|---|---|
| General | Authentication level (None, Connect, Call, Packet, Packet Integrity, Packet Privacy) |
| Location | Run on this computer, or specify a remote computer |
| Security | Launch Permissions, Access Permissions, Configuration Permissions |
| Identity | The 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