Class PasswordResetForAD

java.lang.Object
org.forgerock.opendj.examples.PasswordResetForAD

public final class PasswordResetForAD extends Object
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.
  • Method Details

    • main

      public static void main(String[] args)
      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

      public static byte[] encodePassword(String password)
      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