Allow Change password in Active Directory
See original GitHub issueIn order to do a modify password in Active Directory (not admin reset) you need to create a single request with a Delete and then an Add of unicodePwd (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/6e803168-f140-4d23-b2d3-c3a8ab5917d2).
But, since ModifyAttributeCollection
inherits from KeyedCollection<string, DirectoryAttribute>
it does not allow adding 2 attributes with the same name.
What is the purpose for this instead of having it inherit from something like List<DirectoryModificationAttribute>
?
I would be willing to do a pull request, but this is a potential breaking change…
var oldPasswordAttribute = new DirectoryModificationAttribute
{
Name = "unicodePwd",
LdapModOperation = Native.LdapModOperation.LDAP_MOD_DELETE
};
oldPasswordAttribute.Add(Encoding.Unicode.GetBytes($"\"{oldPassword}\""));
var newPasswordAttribute = new DirectoryModificationAttribute
{
Name = "unicodePwd",
LdapModOperation = Native.LdapModOperation.LDAP_MOD_ADD
};
newPasswordAttribute.Add(Encoding.Unicode.GetBytes($"\"{newPassword}\""));
var response = await _ldapConnection.Value.SendRequestAsync(new ModifyRequest(userDistinguishedName, oldPasswordAttribute, newPasswordAttribute));
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Ways to reset Active Directory Password | ADSelfService Plus
Log in to a domain-connected computer and open the Active Directory Users and Computers console. · Find the user account whose password you...
Read more >How can I configure the system to let users change their ...
In the Permissions section, select the Allow check box for "Change Password." Click here to view image; Click OK to accept the changes....
Read more >Permissions required to reset password on ADCU
Click Delegate Control to open the Delegation of Control Wizard. Click Next to proceed past the wizard's welcome page. Click Add . Click...
Read more >How to delegate password reset permissions in Active ...
Right-click the object and select Delegate Control. active directory control wizard screen Beginning the Delegation of Control Wizard. The ...
Read more >How to Change User Passwords in Active Directory
You simply right-click on a user account, select reset password, and providing you have the correct privileges on that account, you can reset...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JManou FYI search attribute collection reverted to dictionary
And there is the option of doing something like this so that it has the same method signatures: