Arikkan
asked on
C# Active Directory Invoke “ChangePassword” cannot contact domain
Our custom application built on ASP.NET C# which uses the Active Directory classes was working just fine to change the password of Active Directory users, but it stopped working as soon as below updates were installed on server
https://support.microsoft.com/en-us/kb/3167679
https://support.microsoft.com/en-us/kb/3177108
Now our password manager application are not able to change password. We un-installed the updated, and it started working just fine. We have a support from Microsoft but they are not willing to assist on this one as they treat this as a coding issue. to me it seems the active directory issue which was working earlier. Application thows the below exception as soon as we invoke the changepassword function:
The system cannot contact a domain controller to service the authentication request. Please try again later. (Exception from HRESULT: 0x800704F1)
Here's the code that we're using:
try
{
State.log.WriteLine("Conne cting LDAP.");
string ldapPath = "LDAP://192.168.76.3";
DirectoryEntry directionEntry = new DirectoryEntry(ldapPath, domainName + "\\" + userName, currentPassword);
if (directionEntry != null)
{
DirectorySearcher search = new DirectorySearcher(directio nEntry);
State.log.WriteLine("LDAP Connected, searching directory for SAMAccountName");
search.Filter = "(SAMAccountName=" + userName + ")";
SearchResult result = search.FindOne();
if (result != null)
{
State.log.WriteLine("Getti ng User Entry.");
DirectoryEntry userEntry = result.GetDirectoryEntry() ;
if (userEntry != null)
{
userEntry.Invoke("ChangePa ssword", new object[] { currentPassword, newPassword }); //This line gives the error
userEntry.CommitChanges();
State.log.WriteLine("Chang es Committed to ActiveDirectory.");
}
else
{
State.log.WriteLine("Could not get user Entry...");
}
}
else
{
State.log.WriteLine("Searc h returned no results.");
}
}
else
{
State.log.WriteLine("Could not connect to LDAP with given username and passwd");
}
}
I looked at the internet, and it seems many people/company are having this issue after the MS Update.
Could you please let me know if there are some other way to get around this issue without un-installing the updates?
Is Microsoft planning to release different path or security update to overcome this scenario?
Any help will be highly appreciated.
https://support.microsoft.com/en-us/kb/3167679
https://support.microsoft.com/en-us/kb/3177108
Now our password manager application are not able to change password. We un-installed the updated, and it started working just fine. We have a support from Microsoft but they are not willing to assist on this one as they treat this as a coding issue. to me it seems the active directory issue which was working earlier. Application thows the below exception as soon as we invoke the changepassword function:
The system cannot contact a domain controller to service the authentication request. Please try again later. (Exception from HRESULT: 0x800704F1)
Here's the code that we're using:
try
{
State.log.WriteLine("Conne
string ldapPath = "LDAP://192.168.76.3";
DirectoryEntry directionEntry = new DirectoryEntry(ldapPath, domainName + "\\" + userName, currentPassword);
if (directionEntry != null)
{
DirectorySearcher search = new DirectorySearcher(directio
State.log.WriteLine("LDAP Connected, searching directory for SAMAccountName");
search.Filter = "(SAMAccountName=" + userName + ")";
SearchResult result = search.FindOne();
if (result != null)
{
State.log.WriteLine("Getti
DirectoryEntry userEntry = result.GetDirectoryEntry()
if (userEntry != null)
{
userEntry.Invoke("ChangePa
userEntry.CommitChanges();
State.log.WriteLine("Chang
}
else
{
State.log.WriteLine("Could
}
}
else
{
State.log.WriteLine("Searc
}
}
else
{
State.log.WriteLine("Could
}
}
I looked at the internet, and it seems many people/company are having this issue after the MS Update.
Could you please let me know if there are some other way to get around this issue without un-installing the updates?
Is Microsoft planning to release different path or security update to overcome this scenario?
Any help will be highly appreciated.
ASKER
Why cant I see request attention option for this question ????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER