473,626 Members | 3,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.net Application using Impersonation

I have an application that is using impersonation and when I try to
launch an executable, the executable is started with the
NetworkService account used in the Application Pool identity. My
understanding is that it should launch using the logon account.
Windows 2003, IIS6.0, and ASP.NET 2.0.

Mar 7 '07 #1
2 1338
Under ASP.NET 1.1, running "any.exe" using
Process.Start will always run as the ASP.NET account.

Fortunately, under 2.0, provided you take the necessary steps,
you can run an executable via any account, and even return to
continue executing ASP.NET under your usual account.

See:
http://www.codinghorror.com/blog/archives/000133.html

There's very specific instructions/links there
which will allow you to do what you want to do.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Buck" <bo**********@s entry.comwrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
>I have an application that is using impersonation and when I try to
launch an executable, the executable is started with the
NetworkService account used in the Application Pool identity. My
understanding is that it should launch using the logon account.
Windows 2003, IIS6.0, and ASP.NET 2.0.

Mar 7 '07 #2
On Mar 7, 5:17 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
Under ASP.NET 1.1, running "any.exe" using
Process.Start will always run as the ASP.NET account.

Fortunately, under 2.0, provided you take the necessary steps,
you can run an executable via any account, and even return to
continue executing ASP.NET under your usual account.

See:http://www.codinghorror.com/blog/archives/000133.html

There's very specific instructions/links there
which will allow you to do what you want to do.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ====="Buck" <bob.conac...@s entry.comwrote in message

news:11******** **************@ s48g2000cws.goo glegroups.com.. .
I have an application that is using impersonation and when I try to
launch an executable, the executable is started with the
NetworkService account used in the Application Pool identity. My
understanding is that it should launch using the logon account.
Windows 2003, IIS6.0, and ASP.NET 2.0.- Hide quoted text -

- Show quoted text -
When I run this on my my Windows XP machine, Notepad will start and
run under the username supplied.
Moved application to Windows 2003 and I get the Access denied error. I
can launch notepad as
the user supplied on the W2K3 machine using run as. It still appears
to me that the process is trying to launch as Network Service????/
I
Dim ArgString, pwd As String
Dim Program As New Process
Program.StartIn fo.UserName = "********"
Program.StartIn fo.Domain = "*******"
Dim f As SecureString
f = Nothing
f = New SecureString
Dim b As Char
pwd = "12345"
For Each b In pwd.ToCharArray ()
f.AppendChar(b)
Next b
Program.StartIn fo.Password = f
ID =
System.Security .Principal.Wind owsIdentity.Get Current().Name
Program.StartIn fo.UseShellExec ute = False
Program.StartIn fo.FileName = "notepad.ex e "
Program.StartIn fo.RedirectStan dardOutput = True
Program.StartIn fo.RedirectStan dardError = True
Program.Start()
Program.Standar dOutput.ReadToE nd()
Program.WaitFor Exit(5000)
Program.Close()
Mar 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
10885
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
6
2040
by: Dean R. Henderson | last post by:
I have a DTS Package I am able to execute successfully from a Windows Form application, but I cannot get this to work from an ASP.NET Web Service, although the Web Service impersonates the same user the Windows Form runs under. When I run the Web Service, I make a call to "System.Security.Principal.WindowsIdentity.GetCurrent().Name" and this verifies the user-id is the same account I am logged onto when I successfully run my Windows...
1
2190
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used information from Knowledge Base article 306158, INFO: Implementing Impersonation in an ASP.NET Application to create a procedure to perform impersonation. When I try to execute the DTS Package from ASP.NET, I get the following error: Step...
6
2389
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need it to run using credentials supplied by the user. When using basic authentication this is not an issue since the user has to provide a user name and password. But I don't want to use basic authentication so I created a login form and I am using...
7
1360
by: Bonj | last post by:
Hi I made a naff web application which uses the impersonation method in MSDN (can't find it now, but it basically revolves around creating a token by calling the LogonUser API, calling DuplicateToken API on it, and then calling w.Impersonate() where w is a System.Security.Principal.WindowsIdentity object). This is the only real point of the said web application if I'm brutally honest with myself ;-) however it leaves me curious, as does...
2
2063
by: Johnny Fugazzi | last post by:
I would like to access a network share from my vb.net application. I do not want to map a drive to the share, however. I would also like to specifiy a user credential to use when connecting to the share, as the user running the application will not have security rights to hit the share themselves. Any pointers on this?
2
3087
by: Matthias Wohlmann | last post by:
Hi, I'm getting the following error when trying to start my application using Internet Explorer: "Server cannot access application directory D:\xxx. The directory does not exist or is not accessible because of security settings." In IIS I have set Directory Security for my application to allow Anonymous access (using IUSR_<Server>) and Integrated Windows authentication. In the web.config i have set impersonation="true" userName="test"....
5
20074
by: cooltoriz | last post by:
Hello there, I am not asking how to impersonate a process within C# windows application. I already know that, in C# v2.0, you can easily achieve it using ProcessStartInfo. You can run a process or call external program as of different user. The problem of that design is that the mother application is still running as current user. I know that less privilege is more secure.
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 that I managed to fix. Now, he's getting this error (similar to the one a few weeks ago): Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh"
0
8203
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8368
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.