Impersonation in a console (or Windows) app

H

headdeball

Hi,
I have googled around and searched hell and high water for this but does
anyone know how to set up impersonation in a console app (or a windows
app). I am used to ASP.NET and have traditionally used the web.config file
like this

<configuration>
<system.web>
<authentication mode="windows" />
<identity impersonate="true" />
</system.web>
</configuration>

But this doesn't work for my app as obviously system.web is meaningless.
So what do I use instead?

Regards,
hdb
 
A

Alvin Bruney [MVP]

why don't you setup a user account with the correct permissions and
impersonate to the account. You really should impersonate thru code and not
blindly thru the webconfig file since the entire application runs under the
impersonated account.
 

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