访问通过xp_cmdshell拒绝带有参数的SSIS

时间:2015-05-29 18:15:46

标签: ssis sql-server-2008-r2 xp-cmdshell

我上下搜索了一个解决方案,找不到任何有用的东西。我尝试的所有东西似乎都没有用。

我有两个数据库。我无法通过添加表或类似的东西来修改数据库A.我无法启用跨数据库访问。我相信我不能使用sp.Start_job,因为我需要传递参数。我能够启用xp_cmdshell。

我的数据库定义:

Database A 
    - Order table 
Database B 
    - Email notification Table  

我需要做什么:

Any time an order is entered into Database A, I need to enter a row into Database B with values of the order. So I need to have parameters

我尝试了什么:

- xp_cmdshell @query='DTEXEC /f "\\Server\Folder\SSIS Packages\Order confirmations\Order confirmations\Package.dtsx" /DECRYPT password'
   1. I get an error saying access denied.  I tried setting up sp_xp_cmdshell_proxy_account (##xp_cmdshell_proxy_account##) to an account that has access to the network drive where the file is stored, no luck.
   2. whoami.exe shows NT/Authority \System instead of my proxy account.
   3. GRANT EXECUTE on xp_cmdshell to [mydomain\myAccount] didnt have any affect.

Whoami Results

xp_cmdshell Results

有什么建议吗?如果我使用SQL Server代理进行设置,则作业运行正常。最后,我将从数据库A表上的触发器调用xp_cmdshell将数据输入数据库B,然后在满足某些条件的情况下使用sp_send_dbmail触发电子邮件。

1 个答案:

答案 0 :(得分:0)

我目前唯一可以找到的方法(如果没有在SQL和网络中重新设置权限,就是给SQL服务器提供读/执行权限。不是我理想的解决方案,但它可以工作。

希望这有助于某人