【问题标题】:which port(s) are used by DirectoryEntry?DirectoryEntry 使用哪些端口?
【发布时间】:2012-01-23 17:03:01
【问题描述】:

我的目标是从远程服务器获取网站名称列表。但我得到了例外:

RPC 服务器不可用。

代码如下:

    public List<string> GetWebSites(string serverIP)
    {
        List<string> names = new List<string>();
        DirectoryEntry Services = new DirectoryEntry(string.Format("IIS://{0}/W3SVC", serverIP));
        Services.Username = "user name";
        Services.Password = "password";
        IEnumerator ie = Services.Children.GetEnumerator();
        DirectoryEntry Server = null;

        while (ie.MoveNext())
        {
            Server = (DirectoryEntry)ie.Current;
            if (Server.SchemaClassName == "IIsWebServer")
            {
                names.Add(Server.Properties["ServerComment"][0].ToString());
            }
        }

        return names;
    }

当机器上的防火墙关闭时,这工作正常。

我需要知道的是,DirectoryEntry 使用了哪些端口? 或者有没有其他方法可以在不关闭防火墙的情况下获取网站名称?

【问题讨论】:

  • 它将使用(广泛的)端口。如果您需要将其强制到特定端口或更小范围,请查看here。如果我没记错的话,你还需要 UDP 389。

标签: c# iis port firewall directoryentry


【解决方案1】:

我相信 LDAP 协议使用 TCP 不是吗?非 SSL 应该是 389 端口,SSL 应该是 636

【讨论】:

    猜你喜欢
    • 2012-09-29
    • 2022-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-08
    • 2014-04-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多