code: def run_winexe_command(cmd, args, host, username, password, port=445):
      '''
      Run a command remotly via the winexe executable
      '''
      creds = "-U '{0}%{1}' //{2}".format(
          username,
          password,
          host
      )
      logging_creds = "-U '{0}%XXX-REDACTED-XXX' //{1}".format(
          username,
          host
      )
      cmd = 'winexe {0} {1} {2}'.format(creds, cmd, args)
      logging_cmd = 'winexe {0} {1} {2}'.format(logging_creds, cmd, args)
      return win_cmd(cmd, logging_command=logging_cmdf run_winexe_command(cmd, args, host, username, password, port=445):
      '''
      Run a command remotly via the winexe executable
      '''
      creds = "-U '{0}%{1}' //{2}".format(
          username,
          password,
          host
      )
      logging_creds = "-U '{0}%XXX-REDACTED-XXX' //{1}".format(
          username,
          host
      )
      cmd = 'winexe {0} {1} {2}'.format(creds, cmd, args)
      logging_cmd = 'winexe {0} {1} {2}'.format(logging_creds, cmd, args)
      return win_cmd(cmd, logging_command=logging_cmd)
docs: Run a command remotly via the winexe executable