| Author |
Message |
fredr1k
Joined: 03 Apr 2008 Posts: 2
|
Posted: Thu Apr 03, 2008 10:24 am Post subject: Impersonate while scripting or running external commands? |
|
|
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 |
|
 |
dlkj
Joined: 14 Aug 2007 Posts: 150 Location: Red Gate Software, Cambridge
|
Posted: Thu Apr 03, 2008 1:20 pm Post subject: |
|
|
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 |
|
 |
fredr1k
Joined: 03 Apr 2008 Posts: 2
|
Posted: Fri Apr 04, 2008 8:38 am Post subject: |
|
|
Daniel,
Thanks for the input. I was totaly unaware of this command 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.  |
|
| Back to top |
|
 |
|
|
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