473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rookie: How to run application with specific user account?

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
1 4040
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3090
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with...
13
2246
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). ...
3
1791
by: Phillip N Rounds | last post by:
What I would like to do is to have a console application on my server started when a user performs a specific action on a web form. Specifically, MyConsoleApp overwrites an existing file with...
5
2945
by: toddles666 | last post by:
Hi- Is there any way of restricting access to a database by application & account? For example, I only want the application APP1 to access the database using the USER1 account. I've tried to...
7
3010
by: Alice Wong | last post by:
I am setting up my Web ASP.net application to connect to Sql server using windows authentication. I set up IIS to have integrated windows authenication and sql to allow Windows authentication....
1
3042
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
13
4719
by: Kevin Liebowicz | last post by:
Yes, I wasted the past two days trying to fix this. Yes, this is on a Win2003 Server. Yes, this machine is a domain controller. Yes, I seen the dozens of KB articles like this one:...
7
1145
by: Bolwerk | last post by:
Hello I got a client who uses what appears to be ASP.NET 2.0. I come from a UNIX/PHP/Apache background, and I'm not too familiar with ASP.NET. He had some permissions problem a few weeks ago...
3
4713
by: Joseph Geretz | last post by:
I created a new Application Pool for my ASP.NET application since I want it to run under a specific user identity with privileges to access the application database. (I don't want to grant access...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.