Impersonation Windows ID in .Net Cosole applicaion

B

bvasanth123

Hi,
I am developing VB.Net console application. This console application
will be invoke by the scheduler. The id under which this console
application will NOT have access to SQL DB and windows 2000 file share.
I would like to impersonate using proper widnows domain id
programmatically to acces SQL 2000 server and windows 2000 file share.

My dev OS is WINDOWS XP SP2, and Prod OS is WINDOWS 2003.
My console application should be able to impersonate the windows domain
id so that it can access SQL DB (using win authentication) and WINDOWS
2000 file share like \\servername\folder. **I would running console app
in both dev (XP) and prod (Win 2003)**

How can I acheive this imperosnation programmatially?. I heard of
LogonUser and impersonate() methods.
Should I use impersonate() or impersonateLoggedonUser()?. WHat is the
difference between them?..any caveats using each of them
Regards,
Vasanth
 
K

Ken Tucker [MVP]

Hi,

http://www.dotnet247.com/247reference/msgs/28/144136.aspx

Ken
----------------
Hi,
I am developing VB.Net console application. This console application
will be invoke by the scheduler. The id under which this console
application will NOT have access to SQL DB and windows 2000 file share.
I would like to impersonate using proper widnows domain id
programmatically to acces SQL 2000 server and windows 2000 file share.

My dev OS is WINDOWS XP SP2, and Prod OS is WINDOWS 2003.
My console application should be able to impersonate the windows domain
id so that it can access SQL DB (using win authentication) and WINDOWS
2000 file share like \\servername\folder. **I would running console app
in both dev (XP) and prod (Win 2003)**

How can I acheive this imperosnation programmatially?. I heard of
LogonUser and impersonate() methods.
Should I use impersonate() or impersonateLoggedonUser()?. WHat is the
difference between them?..any caveats using each of them
Regards,
Vasanth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top