def get_servers():
    ret = list()

    with salt.utils.winapi.Com():
        try:
            connection = wmi.WMI(namespace=_WMI_NAMESPACE)
            objs = connection.IIsSmtpServerSetting()

            for obj in objs:
                ret.append(str(obj.Name))
        except wmi.x_wmi as error:
            _LOG.error('Encountered WMI error: %s', error.com_error)
        except (AttributeError, IndexError) as error:
            _LOG.error('Error getting IIsSmtpServerSetting: %s', error)

    _LOG.debug('Found SMTP servers: %s', ret)
    return ret
Wrapper func to be used with command.Apply to delete temporary objects.
dataset/ETHPy150Open saltstack/salt/salt/modules/win_smtp_server.py/get_servers--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/copy_helper.py/_DeleteTempComponentObjectFn