createprocessasuser

CreateProcessAsUser not working correctly in my experiments..

I am trying to do the following: 1. I am logged in as Administrator account in my XP with SP2 machine running VS.NET 2005 2. This machine also has another account user1 which is a guest account 3. I am running a program as Administrator, from this program i want to launch a notepad.exe process which will be running under the user1 securi...

Calling CreateProcessAsUser from C#

I've been attempting to create a new process under the context of a specific user using the CreateProcessAsUser function of the Windows API, but seem to be running into a rather nasty security issue... Before I explain any further, here's the code I'm currently using to start the new process (a console process - PowerShell to be specifi...

How do I get a valid user token for CreateProcessAsUser?

I have an application that is running as normal user, and a service running as local system. I want the application to be able to tell the service to start the application again, once the service has done some other stuff. (So the application will not be running while the service is doing it's "thing".) In order for the service to be abl...

Loading user profile from a service

In a service, I try to use the following code to launch a program : HANDLE hPipe; HANDLE hToken; PROFILEINFO stProfileInfo; char szUserName[64]; DWORD dwUserNameSize = 64; // Take the identity of the client ImpersonateNamedPipeClient(hPipe); // Retrieve the user name (DOMAIN\USER) GetUserNameEx(NameSamCompatible,szUserName,&dwUserName...

CreateProcessAsUser error 1314

Hi! I want create a process under another user. So I use LogonUser and CreateProcessAsUser. But my problem is, that CreatePtocessAsUser always returns the errorcode 1314, which means "A required privilige is not held by the client". So my question is, what I am doing wrong? Or how can i give the priviliges to the handle? (I think the ha...

Creating a process in a non-zero session from a service in windows-2008-server?

Hi, I was wondering if there is a simple way for a service to create a process in user session? My service is running as a user(administrator) account and not as a LocalSystem acount, therefore i can't use the WTSQueryUserToken function. i have tried calling OpenProcessToken(GetCurrentProcess,TOKEN_ALL_ACCESS,TokenHandle); but whe...

Impersonated process will not log on to Oracle with Windows Authentication

Hello. I am running a asp .net web service on IIS7. The latter is running on a Windows 2008 R2 Server. IIS7/the web service is configured for asp .net impersonation. The worker process owner is set to NETWORK SERVICE. The web service invokes sqlplus.exe impersonated with his/her domain account on the server. I can see that through the...

starting a UAC elevated process from a non-interactive service (win32/.net/powershell)

I'm using a thrid party Windows service that handles some automation tasks by running scripts and executables using CreateProcessAsUser(). I'm running into problems on Windows Server 2008 due to UAC and way the LUA elevation is handled through the APIs. The service runs as LocalSystem and does not have "Interact With Desktop" enabled. T...

Windows 2008 RenderFarm Service: CreateProcessAsUser "Session 0 Isolation" and OpenGL

Hello, I have a legacy Windows server service and (spawned) application that works fine in XP-64 and W2K3, but fails on W2K8. I believe it is because of the new "Session 0 isolation" feature. Consequently, I'm looking for code samples/security settings mojo that let you create a new process from a windows service for Windows 2008 Serv...

CreateProcessAsUser doesn't draw the GUI

Hi, I have a windows service running under "SYSTEM" account that checks if a specific application is running for each logged in user. If the application is not running, the service starts it (under corresponding user name). I'm trying to accomplish my goal using CreateProcessAsUser(). The service does start the application under corresp...

Delphi and CreateProcessAsUser example?

Does anyone have an example of how to use CreateProcessAsUser in Delphi? I'm using Delphi 2009, not the .NET Delphi. ...

LogonUser -> CreateProcessAsUser from a system service

I've read all the posts on Stack Overflow about CreateProcessAsUser and there are very few resolved questions, so I'm not holding my breath on this one. But it seems like I'm definitely missing something, so it might be easy. The target OS is Windows XP. I have a service running as "Local System" from which I want to create a process ru...

Get Window Station for a non-interactive user per process, user or session?

When using CreateProcessAsUser we pass STARTUPINFO and with lpDesktop NULL, the target is winsta0/default, the interactive desktop of the interactive user. I wish to target a window station in another session of a second, non-interactive user, say a remote desktop user. I assume that it can't be winsta0 because that's reserved for the ...

How to get Currently logged user's session ID?

I'm running a process from inside a windows service using ProcessStartInfo processStartInfo = new .... Process.Start(processStartInfo); The problem is, if I run service under local system account, it runs alright, but it doesn't show the programs' window. I've tried to put user credentials in service properties, but then 'Allow serv...

Run app from a service using CreateProcessAsUser

I'm still trying to run an app calling it from windows service. I tried to use the way described by Scott Allen. It works. But still I can't bring the app to the screen to interact with it. Help me pls. Even if I'm telling it to run the service using my credentials it doesn't bring the app on my desktop. tell me please how to get the cu...

Is it possible silently run something as Administrator

How to trick UAC in Vista and Windows 7? How can I run something that needs not just administrator rights, but especially must be told to run as Administrator. I've tried start a process with given admin credentials, and even tried to use win32 function CreateProcessAsUser, but still unless I tell it manually "run as Administrator" it d...

Create Process with FS Virtualization Enabled

With UAC disabled, I need to create a process with the same characteristics as the process created with UAC enabled - basically I'm emulating process creation with UAC enabled. My only roadblock is virtualization. The sample code below should create an instance of notedpad at medium IL with virtualization enabled. In actuality, it cre...