Comments
2 comments
-
We have a similar situation here. But in my opinion it isnt necessarily RedGate's obligation to support changing windows credentials... after all - Enterprise Manager, Query Analyser and the like don't allow you to enter different windows credentials - they only operate off the currently logged on user.
If you want to run a program under different windows credentials, the "normal windows way" is to shift-right click the shortcut (or simply right click it if it's in the start menu) and choose "Run As..." This then prompts you with which windows credentials to run the aplpication under. Then when you choose windows authentication within the program, you will have the access required.
We use this for running Enterprise Manager and Query Analyser under priveledged user who can make permissions modifications etc
It can be a little annoying to always have to specify the user, so you can actually create a shortcut using the windows runas.exe
You can even have it not ask you for the password everytime, if you specify the /savecred switch (perfect for test systems)
Also note that <path_to_application> cannot contain spaces, since the entire shortcut command needs to be in quotes anyway... to get around this use the shortened DOS paths (can find these out by using dir /x )
eg to run SQLCompare as user myuser, and only supply the password the very first time, create the shortcut with
"c:\windows\system32\runas.exe /user:myuser /savecred c:\progra~1\redgat~1\sqlcompare.exe"
Hope that workaround helps you out -
Although we also use the context menu to "run as..." it would be nice if I could do it in SQL compare, since I may not be sure which database credentials I need to use until after I launch the EXE.
And what if I have different credentials for the 2 different DBs I want to compare? (probably wouldn't happen, but....)
Thanks for the great tip-I wasn't aware of runas.exe - works great! :P
Add comment
Please sign in to leave a comment.
Scenerio: administrators have both regular and admin IDs at our company. I normally would always log in to the PC with my regular account. But my admin ID is given rights to sql server so I need to specify that ID to get access to the DB.