def METHOD_NAME(self, user: User, password: str):
    """Change user's password"""
    user_dn = user.attributes.get(LDAP_DISTINGUISHED_NAME, None)
    if not user_dn:
        LOGGER.info(f"User has no {LDAP_DISTINGUISHED_NAME} set.")
        return
    try:
        self._connection.extend.microsoft.modify_password(user_dn, password)
    except (LDAPAttributeError, LDAPUnwillingToPerformResult):
        self._connection.extend.standard.modify_password(user_dn, new_password=password)