def _findOptionValueInSeceditFile(option):
 try:
  _d = uuid.uuid4().hex
  _tfile = '{0}\\{1}'.format(__salt__['config.get']('cachedir'), 'salt-secedit-dump-{0}.txt'.format(_d))
  _ret = __salt__['cmd.run']('secedit /export /cfg {0}'.format(_tfile))
  if _ret:
   _reader = codecs.open(_tfile, 'r', encoding='utf-16')
   _secdata = _reader.readlines()
   _reader.close()
   _ret = __salt__['file.remove'](_tfile)
   for _line in _secdata:
    if _line.startswith(option):
     return (True, _line.split('=')[1].strip())
  return (True, 'Not Defined')
 except Exception as e:
  log.debug('error occurred while trying to get secedit data')
  return (False, None)

def _findOptionValueInSeceditFile ( option ) : try : _d = uuid . uuid4 ( ) . hex _tfile = '{0}\\{1}' . format ( __salt__ [ 'config.get' ] ( 'cachedir' ) , 'salt-secedit-dump-{0}.txt' . format ( _d ) ) _ret = __salt__ [ 'cmd.run' ] ( 'secedit /export /cfg {0}' . format ( _tfile ) ) if _ret : _reader = codecs . open ( _tfile , 'r' , encoding = 'utf-16' ) _secdata = _reader . readlines ( ) _reader . close ( ) _ret = __salt__ [ 'file.remove' ] ( _tfile ) for _line in _secdata : if _line . startswith ( option ) : return ( True , _line . split ( '=' ) [ 1 ] . strip ( ) ) return ( True , 'Not Defined' ) except Exception as e : log . debug ( 'error occurred while trying to get secedit data' ) return ( False , None )
helper function to dump/parse a secedit /export file for a particular option .