Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Permission to XP_CMDSHELL

Author  Topic 

carumuga
Posting Yak Master

174 Posts

Posted - 2009-05-21 : 08:33:03
Hi,

Anyone quickly tell me the exact syntax for providing access to XP_CMDSHELL command so that the non sys-admins (both windows domain and sql logins)can execute this with out any problem. This i need it as a script as i'm preparing the deployment checklist and sending out to the person who doesnt have any knowledge on that part.

Thanks in advance

jholovacs
Posting Yak Master

163 Posts

Posted - 2009-05-21 : 10:11:04
first, you need to set credentials for the proxy account:
sp_xp_cmdshell_proxy_account 'Username', 'Pa$$w0rd'
(this account has to exist on the machine)
Then you need to enable xp_cmd_shell:
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO


see http://msdn.microsoft.com/en-us/library/ms190693.aspx for more details.



SELECT TOP 1
w.[name]
FROM
dbo.women w
INNER JOIN
dbo.inlaws i
ON
i.inlaw_id = w.parent_id
WHERE
i.net_worth > 10000000
AND
i.status IN ('dead', 'dying')
AND
w.husband_id IS NULL
ORDER BY
w.hotness_factor DESC
Go to Top of Page
   

- Advertisement -