<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _set_wmi_setting(wmi_class_name, setting, value, server):
    '''
    Set the value of the setting for the provided class.
    '''
    with salt.utils.winapi.Com():
        try:
            connection = wmi.WMI(namespace=_WMI_NAMESPACE)
            wmi_class = getattr(connection, wmi_class_name)

            objs = wmi_class(Name=server)[0]
        except wmi.x_wmi as error:
            _LOG.error('Encountered WMI error: %s', error.com_error)
        except (AttributeError, IndexError) as error:
            _LOG.error('Error getting %s: %s', wmi_class_name, error)

        try:
            setattr(objs, setting, value)
            return True
        except wmi.x_wmi as error:
            _LOG.error('Encountered WMI error: %s', error.com_error)
        except AttributeError as error:
            _LOG.error('Error setting %s: %s', setting, error)
    return False