def get_server_setting(settings, server=_DEFAULT_SERVER):
 ret = dict()
 if (not settings):
  _LOG.warning('No settings provided.')
  return ret
 with salt.utils.winapi.Com():
  try:
   connection = wmi.WMI(namespace=_WMI_NAMESPACE)
   objs = connection.IIsSmtpServerSetting(settings, Name=server)[0]
   for setting in settings:
    ret[setting] = str(getattr(objs, setting))
  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)
 return ret

def get_server_setting ( settings , server = _DEFAULT_SERVER ) : ret = dict ( ) if ( not settings ) : _LOG . warning ( 'No settings provided.' ) return ret with salt . utils . winapi . Com ( ) : try : connection = wmi . WMI ( namespace = _WMI_NAMESPACE ) objs = connection . IIsSmtpServerSetting ( settings , Name = server ) [ 0 ] for setting in settings : ret [ setting ] = str ( getattr ( objs , setting ) ) 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 ) return ret
get the value of the setting for the smtp virtual server .