Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

createProcessAsUser from ISAPI under NT4

Posted on 1998-03-18
7
Medium Priority
?
486 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 2640 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

876 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