createProcessAsUser from ISAPI under NT4

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);
LVL 1
dionysos_swampAsked:
Who is Participating?
 
moriesConnect With a Mentor Commented:
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
 
dionysos_swampAuthor Commented:
ff@writeme.com, this better be good.
0
 
moriesCommented:
look here http://sunsite.icm.edu.pl/delphi/ftp/d20free/ntsupas1.zip
then you can download it.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
dionysos_swampAuthor Commented:
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
 
moriesCommented:
i'm sorry i only wanted to help. do you want your points back.
0
 
dionysos_swampAuthor Commented:
Naa, whats the point:)
0
 
eskCommented:
mories, can you send me this NTsu like service esk10000@hotmail.com

Thanks
0
All Courses

From novice to tech pro — start learning today.