Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Impersonation Vs RunAs

Reply
 
Old 05-02-2009   #1 (permalink)
Avi


 
 

Impersonation Vs RunAs

Hi,

I want to execute a piece of my code under the admin privs.I can do it
in dot net using advapi.dll's functions. Does any one has clue if this
is possible in vbscript.

Actually i need to connect to a database and extract some records from
there under the different user privilagegs..

One approach i have is - create an excel macro, and call that from my
vbscript code.this macro takes ADODB Connection object by reference,
create an impersonate user and overrides the connection under
different user's privs. I am able to use that perfectly but this
approach does not look very decent.

Other approach is to create an activeX dll in .NET and call it in
VBS.

Can anyone suggest a better solution or any pointer to do it in
vbscript itself.

Thanks,
Avinash

My System SpecsSystem Spec
Old 05-11-2009   #2 (permalink)
Malcolm McCaffery


 
 

Re: Impersonation Vs RunAs

Can you show how you are currently connecting to the database?

"Avi" <avi.iitr@xxxxxx> wrote in message
news:eb8bce1b-48a1-4464-9054-467b18cdc211@xxxxxx
Quote:

> Hi,
>
> I want to execute a piece of my code under the admin privs.I can do it
> in dot net using advapi.dll's functions. Does any one has clue if this
> is possible in vbscript.
>
> Actually i need to connect to a database and extract some records from
> there under the different user privilagegs..
>
> One approach i have is - create an excel macro, and call that from my
> vbscript code.this macro takes ADODB Connection object by reference,
> create an impersonate user and overrides the connection under
> different user's privs. I am able to use that perfectly but this
> approach does not look very decent.
>
> Other approach is to create an activeX dll in .NET and call it in
> VBS.
>
> Can anyone suggest a better solution or any pointer to do it in
> vbscript itself.
>
> Thanks,
> Avinash
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
vbscritp Sql Impersonation VB Script
Impersonation VB Script
runas /user:USER problem and a strange behavior of runas Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46