Solved

createProcessAsUser from ISAPI under NT4

Posted on 1998-03-18
7
477 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now