Criei um método para redefinição de senha simples, mas sempre que tenta redefinir e senha do usuário encontrado emite a seguinte mensagem de erro:
O servidor RPC não está disponível. (Exceção de HRESULT: 0x800706BA)
I have created a method for simple password reset, but whenever I try to reset and found user's password it issues the following error message:
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Alguém pode me informar a solução para este problema?
Utilizei a mesma função para AD diferentes e a mesma funcionou, mas para um dos AD está com esta falha.
Can anyone tell me the solution to this problem?
I used the same function for different ADs and it worked, but for one of the ADs it is with this fault.
public static DirectoryEntry ResetPassword(string pNewPassWord, Dictionary<string, string> pFilters, AuthenticationTypes pTAutentication = AuthenticationTypes.Secure, bool? pwdLastSet = null)
{
try
{
DirectoryEntry userFound = Search(pFilters, pTAutentication);
if (userFound != null && IsActive(userFound))
{
try
{
userFound.Invoke("SetPassword", new object[] { pNewPassWord });
userFound.Properties["pwdLastSet"].Value = 0;
userFound.CommitChanges();
return userFound;
}
catch (Exception e)
{
throw new Exception("The AD server declined the Reset request: " + e.Message + e.StackTrace, e.InnerException);
}
}
else
{
throw new Exception("User not found in Active Directory!");
}
}
catch (Exception ex)
{
throw new Exception("Failed to reset password in Active Directory: " + ex.Message, ex.InnerException);
}
}