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.
| Author |
Topic |
|
skillile
Posting Yak Master
208 Posts |
Posted - 2002-06-06 : 10:28:20
|
| I would like to run xp_cmdshell on remote servers but I am runninginto access issues. Is there a way to set a user (grant) on the flythen (revoke) after completion?ie.create procasxp_cmdshell dir blah... with this user xp_cmdshell dir blah... with another userThanksslow down to move faster... |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-06-06 : 10:53:37
|
| Can't test this one right now, no access to a machine with SQL, but...Create a role that has the rights run the XP_cmdshell on the remote machine. Inside your stored Proc, use sp_addrolemember and sp_droprollmember to add and remove the user to this roll. Heh, I'm probably somewhere out in left field with this one though... I need beer------Heres when I edit my post with arrows pointing downward telling you to read setbased's answer... it makes a little more senseEdited by - M.E. on 06/06/2002 11:02:03 |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-06-06 : 10:55:46
|
| You're better off writing a procedure on the remote server that makes the specific xp_cmdshell call you need, rather than having the caller go direct to xp_cmdshell. Then you won't need to grant/revoke.setBasedIsTheTruepath<O> |
 |
|
|
|
|
|