By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,503 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,503 IT Pros & Developers. It's quick & easy.

Rookie: How to run application with specific user account?

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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>
----------------------------------------------

"Dave Guenthner" <Da**@Guenthners.com> wrote in message
news:11****************************@phx.gbl...
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

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.