Package org.forgerock.opendj.examples
Class PasswordResetForAD
java.lang.Object
org.forgerock.opendj.examples.PasswordResetForAD
This command-line client demonstrates how to reset a user password in
Microsoft Active Directory.
The client takes as arguments the host and port of the Active Directory server, a flag indicating whether this is a self-reset (user changing own password) or an administrative reset (administrator changing a password), the DN and password of the user performing the reset, and target user DN and new user password.
The client takes as arguments the host and port of the Active Directory server, a flag indicating whether this is a self-reset (user changing own password) or an administrative reset (administrator changing a password), the DN and password of the user performing the reset, and target user DN and new user password.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]encodePassword(String password) Encode new password in UTF-16LE format for use with Active Directory.static voidReset a user password in Microsoft Active Directory.
-
Method Details
-
main
Reset a user password in Microsoft Active Directory.
The connection should be LDAPS, not LDAP, in order to perform the modification.- Parameters:
args- The command line arguments: host, port, "admin"|"self", DN, password, targetDN, newPassword
-
encodePassword
Encode new password in UTF-16LE format for use with Active Directory.- Parameters:
password- String representation of the password- Returns:
- Byte array containing encoded password
-