DirectoryEntry使用哪些端口? [英] which port(s) are used by DirectoryEntry?
本文介绍了DirectoryEntry使用哪些端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的目标是从远程服务器获取网站名称列表。但是我得到了例外:
My goal is to get the list of web site names from remote server. But I'm getting the exception:
RPC服务器不可用。
The RPC server is unavailable.
以下是代码:
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;
}
当机器上的防火墙关闭时,此工作正常。
this works fine, when firewall is turned off on the machine.
我需要知道的是,DirectoryEntry使用哪些端口?
或者是否有其他方式获取网站名称,而不关闭防火墙?
What I need to know is, which port(s) are used by DirectoryEntry? or is there any other way to get web site names, without turning off firewall?
推荐答案
我相信LDAP协议使用TCP没有?对于非ssl应该是端口389而对于SSL来说应该是636
I believe LDAP protocol uses TCP no? Should be port 389 for non-ssl and 636 for SSL
这篇关于DirectoryEntry使用哪些端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文