简体   繁体   English

SSIS 运行 PS1(powershell)作业,但 SSMS 代理不运行

[英]SSIS runs PS1 (powershell) job but SSMS Agent don't

I have a package on SSIS that runs a .BAT file which consequently runs a .PS1 file (powershell).我在 SSIS 上有一个包,它运行一个 .BAT 文件,因此运行一个 .PS1 文件(powershell)。 This Powershell file converts an Excel file to CSV, so I can import the data more easily and conveniently.这个 Powershell 文件将 Excel 文件转换为 CSV,因此我可以更轻松方便地导入数据。

The problem is that when creating a schedule via SQL Agent Job and running this job, it does not do the step of opening the Excel file and converting it normally.问题是,通过SQL Agent Job创建调度并运行该作业时,它没有执行打开Excel文件并正常转换的步骤。 Via SSIS it works, running the package via SSMS (Integration Services Catalog) also works, but via Agent it doesn't.通过 SSIS 它可以工作,通过 SSMS(集成服务目录)运行包也可以工作,但通过代理则不行。

What I've tried:我试过的:

I have already given permission in the folder for several SQL and SSIS users (I don't know if I gave it to everyone).我已经在文件夹中给了几个 SQL 和 SSIS 用户的权限(不知道有没有给大家)。

I already activated the functionality to use via SQL window (but the command also doesn't work, it gives an error).我已经激活了通过 SQL 窗口使用的功能(但该命令也不起作用,它给出了错误)。 As answer: Enable 'xp_cmdshell' SQL Server作为答案:启用'xp_cmdshell' SQL Server

I have already given permission for the components through DCOMCNFG.我已经通过 DCOMCNFG 授予了对组件的许可。 As answer: DCOM , DCOM 2作为答案: DCOMDCOM 2

I have already given permission within the SSMS itself.我已经在 SSMS 内部授予了许可。

I have already created a proxy and used a credential and when running the job with that proxy, it also does not run.我已经创建了一个代理并使用了一个凭证,当使用该代理运行作业时,它也没有运行。 As answer: Proxy answer , Proxy answer 2作为答案:代理答案代理答案 2

But I don't know what I could do for the process to run correctly via Agent, manually and via SSIS it works perfectly.但是我不知道我可以做些什么来使流程通过代理、手动和通过 SSIS 正确运行,它可以完美运行。 But not automatic.但不是自动的。 Does SSIS have any specific users when running that they have permission and the SSMS Agent does not? SSIS 在运行时是否有任何特定用户拥有权限而 SSMS 代理没有? (Although I have tried to give permission everywhere). (虽然我试图在任何地方给予许可)。

Thanks!谢谢!

问题出在 DCOM 配置中的 Excel 应用程序中,因此查看此链接DCOM config ,我能够修复它并正确运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM