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)
 xp_cmdshell Credentials

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-05-01 : 09:16:08
Hi

Does anyone know the correct syntax to run a xp_cmdshell command using different sql server credentials?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-01 : 13:03:53
Didnt get your question. Are you trying to run xp_cmdshell using a non sysadmin roled member account? Are you trying to execute it by impersonating another account?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-01 : 13:04:30
Did you setup a proxy account?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-01 : 13:20:03
You need to setup a proxy account if you dont have one as Tara suggested.use xp_sqlagent_proxy_account extended sp for that

http://msdn.microsoft.com/en-us/library/aa260700(SQL.80).aspx
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-05-02 : 04:35:02
Hi

Yes I have setup a proxy account, but how would I use this account to run the package in xp_cmdshell. I am trying to run a dtexec package.

Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-02 : 05:22:54
As per books online you dont need to do anything. xp_cmdshell will automatically try to run under proxy account if the owner is not a member of sysadmin role.You need to use sp_xp_cmdshell_proxy_account to associate a proxy account to cmdshell.
Go to Top of Page
   

- Advertisement -