def get_servers():
 cmd = ['w32tm', '/query', '/configuration']
 lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
 for line in lines:
  try:
   if line.startswith('NtpServer:'):
    (_, ntpsvrs) = line.rstrip(' (Local)').split(':', 1)
    return sorted(ntpsvrs.split())
  except ValueError as e:
   return False
 return False

def get_servers ( ) : cmd = [ 'w32tm' , '/query' , '/configuration' ] lines = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . splitlines ( ) for line in lines : try : if line . startswith ( 'NtpServer:' ) : ( _ , ntpsvrs ) = line . rstrip ( ' (Local)' ) . split ( ':' , 1 ) return sorted ( ntpsvrs . split ( ) ) except ValueError as e : return False return False
get list of configured ntp servers cli example: .