|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Impersonation with VB.net 2.0 and SQL 2000 help neededI'm having a little trouble getting access to a few commands in our 65 odd SQL databases. Have had a chat to our DBA's and they wont give my windows account access and they also wont give me a SQL login in order to run these tasks. :-( The good news is that i do have access to run these certian tasks as another NT user. The bad news is i cant add this to my connection string. The lovely people at Microsoft talked about using Impersonation? Would this work and how would i go about using this with VB.net 2.0 (visual studio 20005) Any help on this would be great, Andy Use Run As when you start your executable.
-- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Backwards" <And***@technicaltraining.co.nz> wrote in message news:1145762811.962778.113820@g10g2000cwb.googlegroups.com... > Hey everybody > > I'm having a little trouble getting access to a few commands in our 65 > odd SQL databases. > Have had a chat to our DBA's and they wont give my windows account > access and they also wont give me a SQL login in order to run these > tasks. :-( > > The good news is that i do have access to run these certian tasks as > another NT user. > > The bad news is i cant add this to my connection string. > > The lovely people at Microsoft talked about using Impersonation? > > Would this work and how would i go about using this with VB.net 2.0 > (visual studio 20005) > > Any help on this would be great, > > Andy > That works but its a major hassle when you have to do it all the time.
Is there anything else i can do? What type of you app is, Win form or ASP.NET?
In either case, if the DBA only allows Windows Security on the SQL Server, then you have to know which Windows user account is running your app. If it is Win form app, the logged in use is the user account that runs your app (unless you use "RUNAS" command and supply different user credential). So, if that user has appropriate access to the SQL Server, your app would run as expected. If he does not have sufficient access, that is good, this is what security is meant to. Have someone else who has access privilege to run the app, not the ones who are not supposed to. Also, with .NET Configuration applet, you can manipulate .NET app/code security on the computer where your app runs If it is ASP.NET, the user account running your ASP.NET app may not be (by default) the user who open a web browser and navigate to your app on a web server. You must know, as developer, which account is used to run the ASP.NET app in order to give the account proper access to required resource, such as SQL Server. Impersonation is one of the option. However, for some reason, you have to use SQL Server security, not Windows security, while the DBA does not accept it, then it is only between you two to make compromise, nothing can help. Show quote "Backwards" <And***@technicaltraining.co.nz> wrote in message news:1145762811.962778.113820@g10g2000cwb.googlegroups.com... > Hey everybody > > I'm having a little trouble getting access to a few commands in our 65 > odd SQL databases. > Have had a chat to our DBA's and they wont give my windows account > access and they also wont give me a SQL login in order to run these > tasks. :-( > > The good news is that i do have access to run these certian tasks as > another NT user. > > The bad news is i cant add this to my connection string. > > The lovely people at Microsoft talked about using Impersonation? > > Would this work and how would i go about using this with VB.net 2.0 > (visual studio 20005) > > Any help on this would be great, > > Andy > Its a windows app rather than a web app. I have another windows user
account that can run this and looks like i'll have to just use the "RunAs" command. Thanks a bunch for your input. On 22 Apr 2006 20:26:52 -0700, "Backwards" <And***@technicaltraining.co.nz> wrote: ¤ Hey everybody¤ ¤ I'm having a little trouble getting access to a few commands in our 65 ¤ odd SQL databases. ¤ Have had a chat to our DBA's and they wont give my windows account ¤ access and they also wont give me a SQL login in order to run these ¤ tasks. :-( ¤ ¤ The good news is that i do have access to run these certian tasks as ¤ another NT user. ¤ ¤ The bad news is i cant add this to my connection string. ¤ ¤ The lovely people at Microsoft talked about using Impersonation? ¤ ¤ Would this work and how would i go about using this with VB.net 2.0 ¤ (visual studio 20005) ¤ The following may work for you: http://msdn2.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext(VS.80).aspx Paul ~~~~ Microsoft MVP (Visual Basic) |
|||||||||||||||||||||||