How to change the password of an Active Directory user using the directory service without knowing the old password?
You are probably looking for a method SetPasswordthat you should call on the object DirectoryEntry.
SetPassword
DirectoryEntry
Check out the Reset User Password: Howto example here : (almost) everything in Active Directory through C # .
EDIT :If you have problems with a null entry in the directory, you are likely to make a mistake. The path should be something like this:
DirectoryEntry entry = new DirectoryEntry("LDAP://CN=johndoe,CN=Users,DC=acme,DC=com");
As an MCSE, I reset my password many times a day, so I can tell you about it.
, Active Directory - reset. , , , , , , reset .
, , Active Directory, , , , .
, , reset , reset, .
.net 3.5 System.DirectoryServices.AccountManagement. .
public void ChangePassword(string dn, string newPassword) { using (var context = new PrincipalContext(ContextType.Domain)) { using (var user = UserPrincipal.FindByIdentity(context, IdentityType.DistinguishedName, dn)) { user.SetPassword(newPassword); } } }
Source: https://habr.com/ru/post/1767110/More articles:writing XML data to an ASP.NET page - c #How to display a Progress Spinner (or other user interface) when the WPF ListView is a DataBound? - .netIs it possible to call a parser from libxml from several asynchronous network calls? - objective-cUnit Testing Framework NUnit & Visual Studio - unit-testingPowerBuilder 12 vs Visual Studio - designer support - visual-studioHow to create a lookup table in C ++? - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1767113/how-to-transfer-data-from-microsoft-access-to-sql-server-2008&usg=ALkJrhgmeuQ_i8zpuGEXdaBogHfrGzpwWQHow Oracle XMLTYPE sleeps - javaHow to compare table structure in SAS - data-structuresHow to add an XML map programmatically to an Excel 2010 spreadsheet? - c #All Articles