Remote macro execution

Since Analyst and Contrib macros are typically packed into .bat files, remote bat execution is a common task.

If you don’t want user to access server via terminal session of some sort, but user still needs to start some administrative task (data transfer, reconciliation or such) remote execution comes into play.

There are 3 basic ways to do this (as I know).

  1. Create a service for remote command execution. Remote Command Service can be used here, but it opens a port on the server, making it vulnerable to possible attacks. First 10 of 20 of google’s links for it are “Exploit Warnings”.
  2. XPcmdshell of Ms SQL Server or it’s analogues for other DB’s. But this requires a DB client software on user PC and password for DB user is sent in clear text.
  3. An VBScript (more specifically WSH) call from the Web Page. Code can be encapsulated into Contributor Help Text Pane, therefore centralizing control for user. Security needs to be properly defined on NTFS level for IUSR and IWM users on server.

Following can be written in Help Pane:

<html>

<body bgcolor="white">

<center>

<h2>Macro List</h2>

<a href="http://servername/directory for asp scripts/scriptname.asp">Macro Name</a> <br>

</center>

And scriptname.asp, add html formatting of your choice:

<%@ LANGUAGE="VBSCRIPT"%>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type"

    CONTENT="text/html; CHARSET=iso-8859-1">

<META NAME="GENERATOR"

    CONTENT="Microsoft FrontPage 2.0">

<TITLE>Launching Macro</TITLE>

</HEAD>

<BODY BGCOLOR="#FFFFFF">

<%

set WSHShell = Server.CreateObject("WScript.Shell")

StartTime=Time()

response.write("Some info")

response.write(StartTime)

'Enter file to execute
err = WSHShell.run("pathfilename.bat",5,true)

EndTime = Time()

Set WSHShell=Nothing

If (err=0) Then response.write("OK")

Else response.write("Error Happened") End If

response.write(EndTime)

%>

</BODY>

</HTML>
 
Your variants OR suggestions?