def set_computer_desc(desc=None):
 system_info = win32net.NetServerGetInfo(None, 101)
 if (desc is None):
  return False
 if (not isinstance(desc, str)):
  desc = desc.decode('utf-8')
 system_info['comment'] = desc
 try:
  win32net.NetServerSetInfo(None, 101, system_info)
 except win32net.error as exc:
  (number, context, message) = exc
  log.error('Failed to update system')
  log.error('nbr: {0}'.format(number))
  log.error('ctx: {0}'.format(context))
  log.error('msg: {0}'.format(message))
  return False
 return {'Computer Description': get_computer_desc()}

def set_computer_desc ( desc = None ) : system_info = win32net . NetServerGetInfo ( None , 101 ) if ( desc is None ) : return False if ( not isinstance ( desc , str ) ) : desc = desc . decode ( 'utf-8' ) system_info [ 'comment' ] = desc try : win32net . NetServerSetInfo ( None , 101 , system_info ) except win32net . error as exc : ( number , context , message ) = exc log . error ( 'Failed to update system' ) log . error ( 'nbr: {0}' . format ( number ) ) log . error ( 'ctx: {0}' . format ( context ) ) log . error ( 'msg: {0}' . format ( message ) ) return False return { 'Computer Description' : get_computer_desc ( ) }
set the windows computer description .