COMException when trying to get application pools using ServerManager
Asked Answered
L

1

6

When I try to get the list of IIS application pools from a remote server using the following code

List<ApplicationPool> appPools;

using (ServerManager serverManager = ServerManager.OpenRemote("XXX")) {
  appPools = serverManager.ApplicationPools.ToList();
}

I get an exception:

System.Runtime.InteropServices.COMException (0x800706BA): Retrieving the COM
class factory for remote component with CLSID
{2B72133B-3F5B-4602-8952-803546CE3344} from machine XXX failed due to the
following error: 800706ba.

Any ideas what might be causing this?

Lore answered 13/1, 2014 at 13:4 Comment(0)
L
11

Turns out the problem can be fixed by adding an appropriate rule in the Firewall:

  • rule type: inbound
  • rule type: custom
  • program: %systemroot%\system32\dllhost.exe
  • protocol: TCP
  • local port: RPC Dynamic Ports
  • remote port: All Ports
  • action: allow connection
  • profile: domain

The above solution was inspired by this thread: Windows Firewall blocking OAB connections.

Lore answered 13/1, 2014 at 13:4 Comment(2)
After hours of searching, this is what fixed my problem.Renner
That did it! Here's some PowerShell to create the rule. New-NetFirewallRule -DisplayName "RPC Dynamic Ports" -Enabled:True -Profile:Domain -Direction:Inbound -Action:Allow -Protocol "TCP" -Program "%systemroot%\system32\dllhost.exe"Comply

© 2022 - 2024 — McMap. All rights reserved.