TransportAgent execute exe Files RRS feed

  • Question

  • Hi,

    I have created a TransportAgent for my Exchange 2013 Server like it is described on this website.


    I only changed the if-condition and added a line to execute a local VBS file.

    To start the VBS file I have added this line in the TransportAgent


    This is working fine. The  VBS file is executed but in my VBS file I want to execute a local exe file and this isnt working.

    My VBS file looks like this.

    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set MyFile = FSO.CreateTextFile("C:\MyProgram\Testfile.txt ", TRUE)
    	Set MyFile = FSO.OpenTextFile("C:\MyProgram\Testfile.txt", 8)
    	MyFile.WriteLine ("Test!")
            MyFile.WriteLine ("End")
    Set WshShell = WScript.CreateObject( "WScript.Shell" )
    WshShell.Run "C:\MyProgram\program.exe",0,True 

    For testing purpose I have added the creation of a testfile to check if the VBS was executed. This is working fine.

    But the "programm.exe" cant be executed. The exe file establishes a connection to an remote server (internet). But this is never executed.

    I think this is because the TransportAgent is executed with the Network Service Account but I don´t know how I can solve this.

    I dont want to give critical rights to the account.

    Can anyone help me?

    Friday, July 19, 2013 9:23 AM

All replies

  • Why would you call a VBS Script to call an EXE (from a routing agent) ???

    You should limit the amount it time spent in an agent event otherwise you risk slowing your Exchange and backlogging email.

    Why not call the EXE directly... or better still, incorporate the functionality provided by your EXE into the agent itself ?

    Scott Quinn | C# developer & messaging specialist (for hire). Contact me at http://au.linkedin.com/in/scottquinn

    Thursday, July 25, 2013 1:09 PM
  • Hi,

    I have tried many things but I cant resolv this problem.

    I cant execute any exe file within an transport agent.
    My problem is that I have a SendConnector for relaying emails to an external smtp server.
    This SMTP Server is only available within an SSH tunnel and I cant use a persistent connection.

    So I want to open the SSH tunnel within the transport agent before the mail is relayed to the SMTP server. For this I am using putty. I have configured a profile so that I can open the SSH tunnel with a command. In the command line this works without problems. But I cant execute the exe file within the transport agent.

    I think that might be a problem with service rights but I don´t know how to solve this.

    Can anyone help me?

    Wednesday, November 6, 2013 5:08 PM