LDAP DirectoryEntry unable to connect via hostname but only via IP address

旧街凉风 提交于 2019-12-24 11:37:59

问题


When I'm trying to connect to an AD in my computer network by writing the following line:

DirectoryEntry de = new DirectoryEntry("LDAP://hostname.local");

I get the following error:

Logon failure: unknown user name or bad password

But when I'm trying to connect to the same computer using its IP I'm able to reach the computer without an error, that is the following line does work:

DirectoryEntry de = new DirectoryEntry("LDAP://The IP of hostname.local");

How is it possible that when I'm trying to use the ldap query with hostname I'm getting Logon failure but when I'm using the host name ip address I reach the computer successfully and able to view its AD contents.

来源:https://stackoverflow.com/questions/27645317/ldap-directoryentry-unable-to-connect-via-hostname-but-only-via-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!