DirectoryEntry oDE = new DirectoryEntry(\"LDAP://DC=Test1,DC=Test2,DC=gov,DC=lk\");
using (DirectorySearcher ds = new DirectorySearcher(oDE))
{
ds.PropertiesToL
A referral was returned from the server error usually means that the IP address is not hosted by the domain that is provided on the connection string. For more detail, see this link:
Referral was returned AD Provider
To illustrate the problem, we define two IP addresses hosted on different domains:
IP Address DC Name Notes
172.1.1.10 ozkary.com Production domain
172.1.30.50 ozkaryDev.com Development domain
If we defined a LDAP connection string with this format:
LDAP://172.1.1.10:389/OU=USERS,DC=OZKARYDEV,DC=COM
This will generate the error because the IP is actually on the OZKARY DC not the OZKARYDEV DC. To correct the problem, we would need to use the IP address that is associated to the domain.