Call ChangePassword with a DirectoryEntry Object

No matter what I try to use, this method always raises the following exception:

         var retVal = this.DirectoryEntry.Invoke("ChangePassword", new object[] { oldPassword, newPassword }) == null;

InnerException = {"The password does not meet the requirements of the password policy. Check the minimum password length, password complexity and password history requirements. (Exception from HRESULT: 0x800708C5)"}

Naturally, I checked the default domain policy (none were found in my test domain), the OU group policy (does not exist) and cannot find anything that could regulate the password policy, but no matter how much or a complex password I I provide in the function, this leads to the same exception. Now the most interesting part is when I do the same (for the same DirectoryEntity object and the same password), calling this:

 var retVal = this.DirectoryEntry.Invoke("SetPassword", new object[] { newPassword }) == null;

The last call is made without any problems.

+5
source share
2 answers

, . Active Directory. , , .

. , .

Default Domain Security Settings

MSDN. .

  • - , .
  • - , . 42 .
  • - , , . 1 .
  • - . 7 .
  • - , , .

0x800708C5. , , " " . 1 . , , .

, , . undefined, . .

  • - 0, ,
  • - 0, ,
  • - 0, , .
  • - 0, ,
  • - , ,

, , - . , - , Active Directory. , . . , , gpupdate.

, . , :)

+7

All Articles