code: def validate_windows_cred_winexe(host,
                            username='Administrator',
                            password=None,
                            retries=10,
                            retry_delay=1):
      '''
      Check if the windows credentials are valid
      '''
      cmd = "winexe -U '{0}%{1}' //{2} \"hostname\"".format(
          username,
          password,
          host
      )
      logging_cmd = "winexe -U '{0}%XXX-REDACTED-XXX' //{1} \"hostname\"".format(
          username,
          host
      )
      for i in range(retries):
          ret_code = win_cmd(
              cmd,
              logging_command=logging_cmd
          )
      return ret_code == f validate_windows_cred_winexe(host,
                            username='Administrator',
                            password=None,
                            retries=10,
                            retry_delay=1):
      '''
      Check if the windows credentials are valid
      '''
      cmd = "winexe -U '{0}%{1}' //{2} \"hostname\"".format(
          username,
          password,
          host
      )
      logging_cmd = "winexe -U '{0}%XXX-REDACTED-XXX' //{1} \"hostname\"".format(
          username,
          host
      )
      for i in range(retries):
          ret_code = win_cmd(
              cmd,
              logging_command=logging_cmd
          )
      return ret_code == 0
docs: Check if the windows credentials are valid