首页 > 系统服务 > 详细

两种方式启用xp_cmdshell

时间:2014-10-24 19:12:34      阅读:361      评论:0      收藏:0      [点我收藏+]
两种方式启用xp_cmdshell 

1.打开外围应用配置器—>

功能的外围应用配置器—>

实例名Database Enginexp_cmdshell—> 启用

2.sp_configure

-- 允许配置高级选项
EXEC sp_configure ‘show advanced options‘, 1
GO
-- 重新配置
RECONFIGURE
GO
-- 启用xp_cmdshell
EXEC sp_configure ‘xp_cmdshell‘, 0
GO
--重新配置
RECONFIGURE
GO

--执行想要的xp_cmdshell语句
Exec xp_cmdshell ‘query user‘
GO

--用完后,要记得将xp_cmdshell禁用(从安全角度安全考虑)
-- 允许配置高级选项
EXEC sp_configure ‘show advanced options‘, 1
GO
-- 重新配置
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure ‘xp_cmdshell‘, 1
GO
--重新配置
RECONFIGURE
GO

 

两种方式启用xp_cmdshell

原文:http://net5x.blog.51cto.com/7900145/1567583

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!