Problems running exe within sql job

  • I have an executable written in .Net that I am trying to execute from a sql server job. (The Type on the job step is set to Operating System(CmdExec)). It fails when the executable is on a network share with the following error:

    Executed as user: . Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers

    Sql Server and the Sql Server Agent are running under a domain account that has sufficient permissions on the remote server.

    If I execute this exe from a command prompt, either as myself or as the sql server service account, it works. If the exe is placed on a local drive of sql server it also works. The only time it fails is within the job against a remote location.

    Regards,
    Rubes

  • This looks more like a .NET error??

    Can u check job's history? are you getting same error there too?



    Pradeep Singh

  • I am seeing the error in the job history.

    Regards,
    Rubes

  • No Clues... Cant find anything on net as well!!:hehe:

    all of these messages relate to .NET only.. No reference to SQL Server.. May be a bug in the system!!

    what version are you running?



    Pradeep Singh

  • I'm running sql 2005 Standard sp3 on windows server 2003 sp2.

    Regards,
    Rubes

  • If you are running your exe from a mapped drive letter, try accessing it with a URN instead.

    If that doesn't work, then see if it works when you copy it locally.

    Finally, you may need to string[/b] name it (see here: http://msdn.microsoft.com/en-us/library/xwb8f617(VS.80).aspx).

    EDIT: Uhh, that should be "strong Name", as "string name" makes no sense. 🙂

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (6/15/2009)


    Finally, you may need to string name it (see here: http://msdn.microsoft.com/en-us/library/xwb8f617(VS.80).aspx)

    Heh. There was I about to post that the assembly needs to be signed, when I thought I'd follow your link to find out what it means to 'string name' something - expecting to find something relating to mapped drives or URNs or whatever! 😀

    Honestly. That is exactly how it happened.

    So yeah. The assembly needs signing (with a strong name).

    Paul

  • Paul White (6/16/2009)


    RBarryYoung (6/15/2009)


    Finally, you may need to string name it (see here: http://msdn.microsoft.com/en-us/library/xwb8f617(VS.80).aspx)

    Heh. There was I about to post that the assembly needs to be signed, when I thought I'd follow your link to find out what it means to 'string name' something - expecting to find something relating to mapped drives or URNs or whatever! 😀

    Honestly. That is exactly how it happened.

    So yeah. The assembly needs signing (with a strong name).

    Paul

    GAahh! :w00t:

    Sometimes a little typo goes a long way... (I will fix) 😀

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (6/15/2009)


    If you are running your exe from a mapped drive letter, try accessing it with a URN instead.

    I'm running it from a UNC path... \\mymasterserver\folder\mine.exe. I tried setting up a mapped drive, hoping that would resolve the issue, but the sql account can't see it (not sure why on that one either). I am not familiar with URNs. Can you give an example?

    RBarryYoung (6/15/2009)


    If that doesn't work, then see if it works when you copy it locally.

    Yes, it does when I copy it locally, but that's what I want to avoid. I need/want a central location.

    RBarryYoung (6/15/2009)


    Finally, you may need to strong[/b] name it (see here: http://msdn.microsoft.com/en-us/library/xwb8f617(VS.80).aspx).

    I will check with the engineers on this.

    Regards,
    Rubes

  • Let us know how it works out.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • I have always done this with WMI in a script task. WMI scripting allows you to assign a namespace, and designate impersonation levels, etc. I suggest using integrated security though, so as not to jeopardize security by scripting the user name and password. To find out more about scripting WMI in SSIS for execution of remote processes click here.

    Karl Lambert
    SQL Server Database Administration
    Business Intelligence Development

  • We've resolved the issue. The DB Server needed .Net 3.5.

    Regards,
    Rubes

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply