Impersonation in a console (or Windows) app

  • Thread starter Thread starter headdeball
  • Start date Start date
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
 
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.
 
Back
Top