对对象xp_cmdshell的权限被拒绝 [英] permission was denied on the object xp_cmdshell

查看:465
本文介绍了对对象xp_cmdshell的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我获得了对对象'xp_cmdshell'的执行权限.

在这种情况下,我有一个名为ExportFile的存储过程. 我正在从Virtual PC的Web应用程序通过SqlCommand调用存储过程. 在执行此命令期间,我得到权限错误

然后我通过SQL事件探查器对其进行调试,并将结果从事件探查器执行到查询窗口(这意味着我使用从事件探查器到查询窗口的必要参数运行StoredProcedure),令人惊讶的是它的工作正常.文件已成功导出.

考虑到我在连接字符串中的登录名是所有者和管理员用户,我不知道这有什么问题.

解决方案

与Web服务器一起使用的SQL用户帐户无权使用该扩展过程.您将不得不提升该用户的权限(不好的主意),或者在SQL安全性内分配一个代理帐户,该帐户可以在服务器内执行该过程而无需将Web帐户设置为Sysadmin.

I am getting Execute permission was denied on the object 'xp_cmdshell'.

Here's the situation, I have a stored procedure called ExportFile. I am calling the stored procedure via SqlCommand from a web application from a Virtual PC.. during the execution of this command i get permission error

Then I debug it via SQL profiler and execute the result from the profiler to a query window (this means i run the StoredProcedure with the necessary parameters basing from the profiler to a Query window) and surprisingly its working just fine. the file was exported successfully.

I wonder whats wrong with this considering that my login in the connection string is an owner and admin user.

解决方案

The SQL user account being used with the web server doesn't have permissions to use that extended procedure. You would have to elevate the rights of that user (bad idea) or assign a proxy account within SQL security that can execute the procedure within the server without making the web account a Sysadmin.

这篇关于对对象xp_cmdshell的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆