public function changePassword($username, $password, $oldPassword, $isGUID = false)
    {
        $this->adldap->utilities()->validateNotNull('Username', $username);
        $this->adldap->utilities()->validateNotNull('Password', $password);
        $this->adldap->utilities()->validateNotNull('Old Password', $oldPassword);

        $this->adldap->utilities()->validateLdapIsBound();

        if (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
            $message = 'SSL must be configured on your webserver and enabled in the class to set passwords.';

            throw new AdldapException($message);
        }

        if (!$this->connection->isBatchSupported()) {
            $message = 'Missing function support [ldap_modify_batch] http://php.net/manual/en/function.ldap-modify-batch.php';

            throw new AdldapException($message);
        }

        $userDn = $this->dn($username, $isGUID);

        if ($userDn === false) {
            return false;
        }

        $modification = [
            [
                'attrib' => 'unicodePwd',
                'modtype' => LDAP_MODIFY_BATCH_REMOVE,
                'values' => [$this->encodePassword($oldPassword)],
            ],
            [
                'attrib' => 'unicodePwd',
                'modtype' => LDAP_MODIFY_BATCH_ADD,
                'values' => [$this->encodePassword($password)],
            ],
        ];

        $result = $this->connection->modifyBatch($userDn, $modification);

        if ($result === false) {
            $error = $this->connection->getExtendedError();

            if ($error) {
                $errorCode = $this->connection->getExtendedErrorCode();

                $msg = 'Error: '.$error;

                if ($errorCode == '0000052D') {
                    $msg = "Error: $errorCode. Your new password might not match the password policy.";

                    throw new PasswordPolicyException($msg);
                } elseif ($errorCode == '00000056') {
                    $msg = "Error: $errorCode. Your old password might be wrong.";

                    throw new WrongPasswordException($msg);
                }

                throw new AdldapException($msg);
            } else {
                return false;
            }
        }

        return true;
    }