如何通过Win Server 2008上的防火墙允许(远程)IISReset

我试图运行以下,重置远程计算机上的IIS。

IISReset <remoteMachine>

如果我禁用域防火墙,一切工作正常。 随着防火墙的启用,我得到了

RPC服务器不可用。

最初我尝试启用远程pipe理(RPC-EPMAP)和任何其他看起来甚至相关的规则。 然后我尝试启用所有预定义的规则,但没有成功。

您可以尝试以下命令行将入站规则添加到Web服务器上的防火墙:

netsh advfirewall firewall add rule name="Remote IIS inetinfo" dir=in action=allow description="Remote IIS Service Managment" program="%systemroot%\System32\inetsrv\inetinfo.exe" enable=yes netsh advfirewall firewall add rule name="COM+ Remote Administration (All Programs)" dir=in action=allow description="" program="%windir%\system32\dllhost.exe" enable=yes localport=RPC protocol=tcp 

当尝试访问IIS服务时,我必须使用这些来解决WMI / RPC问题。 错误如下:

 Creating an instance of the COM component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from the IClassFactory failed due to the following error: 800706ba. 

135/tcp只是端口映射器。 它用于协商在高端口上运行的第二个连接(Server 2008中的49152-65535/tcp ),因此您也需要允许该连接的端口。 为了便于穿越防火墙,可以locking端口 。