December 20, 2009 at 10:30 am
HI,
Sql sever 2005 Express edition
We have a Windows schedule task (.bat file + SQLCMD + stored-proc). We would like to enable xp_cmdshell just before this Windows schedule task and disable xp_cmdshell immediately after this Windows schedule task. How can we do it ?
Thank you
Calico (MCP, MCTS)
December 20, 2009 at 11:34 am
Simple check in Books OnLine does it... 😉 Past the following into the URL box of the help system.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/c147c9e1-b81d-49c8-b800-3019f4d86a13.htm
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2009 at 4:32 pm
Hi,
With SQL Server 2005 Expresse Edition CMDSHELL can be enable / disable with sp_configure or with surface area.
I ask this question because I dont want to manually enable and disable CMDSHELL every night via surface area. Also I cannot put the sp_configure into our SP because our SP cannot be STARTED via Windows Sceduker task, if CMDSHELL has not been enable BEFORE.
With SQL Server 2005 Expresse Edition and Windows Sceduker task, for security best practice, how can we enable /disable CMDSHELL just before / after a SP that is started via Windows Sceduker task ?
Thank you
calico (MCP MCTS)
December 20, 2009 at 5:37 pm
As Jeff's link pointed out, you can easily script the enabling and disabling of xp_cmdshell;
if you had checked BOL before posting a question here, you'd have found it yourself, and not had to wait 8 or so hours:
here's the details from ms's msdn site;http://msdn.microsoft.com/en-us/library/ms190693.aspx
Lowell
December 21, 2009 at 8:01 am
calico-604598 (12/20/2009)
Hi,With SQL Server 2005 Expresse Edition CMDSHELL can be enable / disable with sp_configure or with surface area.
I ask this question because I dont want to manually enable and disable CMDSHELL every night via surface area. Also I cannot put the sp_configure into our SP because our SP cannot be STARTED via Windows Sceduker task, if CMDSHELL has not been enable BEFORE.
With SQL Server 2005 Expresse Edition and Windows Sceduker task, for security best practice, how can we enable /disable CMDSHELL just before / after a SP that is started via Windows Sceduker task ?
Thank you
calico (MCP MCTS)
Remove the "GO"s from the script in the links both Lowell and I have provided. It'll work just fine.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 7:31 pm
Thank you !
I tried it and it works.
Calico (MCP MCTS)
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply