Rookie: How to run application with specific user account?

D

Dave Guenthner

Hi. I have a c# console application that works fine when
it is executed under the context of a user account who is
Administrator of the local machine. However, my
production environment, no end user is a full
Administrator of their machine. Is there a best practice
or way out there to simply specify the credentials of a
user account which has the Admin rights for this app to
run under while being logged into machine with say a
simply domain user account?

Thanks in adavance.

Dave
 
J

John Timney \(Microsoft MVP\)

One way to run apps as another user is to run it from scheduler, that way
you can add credentials right into the scheduler settings. Its only really
appropriate if your app requires no interaction however as it runs in the
background.

Another approach is to use impersonation
http://www.codeproject.com/csharp/cpimpersonation1.asp

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
 

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