Solved

createProcessAsUser from ISAPI under NT4

Posted on 1998-03-18
7
479 Views
Last Modified: 2010-04-06
I need to execute external programs from an ISAPI script, windows NT will not let me do so beacuse the ISAPI runs as a service, that means that everything works when debugging, but not when running from IIS.

I need a good explaination and full source that can execute a user program from ISAPI  preferably one that can interact with the desktop

This (part of my executenow procedure) fails even when debugging the ISAPI
CreateProcessAsUser sets error ERROR_PRIVILEGE_NOT_HELD

loggedon := LogonUser(pchar(username),
                                          pchar(domain),
                                          pchar(password),
                                          LOGON32_LOGON_SERVICE,
                                          LOGON32_PROVIDER_DEFAULT,
                                          htoken);

result := loggedon and CreateProcessAsUser(htoken,
                                                                                nil,
                                                                                pchar(cmdline),
                                                                                nil,
                                                                                nil,
                                                                                false,
                                                                                Create_new_console,
                                                                                nil,
                                                                                nil,
                                                                                SI,
                                                                                PI);
if loggedon then closehandle(htoken);
0
Comment
Question by:dionysos_swamp
  • 3
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
mories earned 660 total points
ID: 1360600
I have some source code in a zip file which is a unix like su program for nt. If you give your e-mail adress i will send you this file.
0
 
LVL 1

Author Comment

by:dionysos_swamp
ID: 1360601
ff@writeme.com, this better be good.
0
 
LVL 1

Expert Comment

by:mories
ID: 1360602
look here http://sunsite.icm.edu.pl/delphi/ftp/d20free/ntsupas1.zip
then you can download it.
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 1

Author Comment

by:dionysos_swamp
ID: 1360603
Well, you got the points, but I didn't get what I wanted, the code for su doesn't seem to work under ISAPI beacuse it runs as a service and doesn't have access to the desktop or console...
0
 
LVL 1

Expert Comment

by:mories
ID: 1360604
i'm sorry i only wanted to help. do you want your points back.
0
 
LVL 1

Author Comment

by:dionysos_swamp
ID: 1360605
Naa, whats the point:)
0
 

Expert Comment

by:esk
ID: 2599927
mories, can you send me this NTsu like service esk10000@hotmail.com

Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question