Red Gate forums :: View topic - Impersonate while scripting or running external commands?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Multi Script 1
SQL Multi Script 1 forum

Impersonate while scripting or running external commands?

Search in SQL Multi Script 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
fredr1k



Joined: 03 Apr 2008
Posts: 2

PostPosted: Thu Apr 03, 2008 10:24 am    Post subject: Impersonate while scripting or running external commands? Reply with quote

hi,

I'm evaluating Multiscript and found it quite nice. But we are performing some tasks that would require me to try to log in as another user and report back the result and optionally make some queries.

Another sugestion, how about a feature to populate the serverlist with a SQL-query? I'm not a big fan of using the serverlist. In that case it would be easy to populate the serverlist with specific servers.
Back to top
View user's profile Send private message
dlkj



Joined: 14 Aug 2007
Posts: 151
Location: Red Gate Software, Cambridge

PostPosted: Thu Apr 03, 2008 1:20 pm    Post subject: Reply with quote

Hi,

There are a couple of ways to impersonate users using Transact-SQL

SQL 2000:
Code:
SETUSER [ 'username' [ WITH NORESET ] ]

http://msdn2.microsoft.com/en-us/library/ms186297.aspx

SQL 2005:
Code:
{ EXEC | EXECUTE ] AS <context_specification>
[;]

<context_specification>::=
{ LOGIN | USER } = 'name'
    [ WITH { NO REVERT | COOKIE INTO @varbinary_variable } ]
| CALLER

http://msdn2.microsoft.com/en-us/library/ms181362.aspx

Thanks for the feedback on the serverlist, this is already something we are considering for a future release of SQL Multi Script.

--
Daniel
Back to top
View user's profile Send private message
fredr1k



Joined: 03 Apr 2008
Posts: 2

PostPosted: Fri Apr 04, 2008 8:38 am    Post subject: Reply with quote

Daniel,

Thanks for the input. I was totaly unaware of this command Smile However it doesnt suite my needs. As a part of a security check i need to connect to the databases to check wether they have some obvious passwords on uses like SA etc. This forces me to make full sql-logon's to the system.

I'm pleased to hear about the population feature of the serverlist. In an enviroment similar to the one I'm sitting on right now it's not unusual with a sql-serverlist of 200+ machines. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group