Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

createProcessAsUser from ISAPI under NT4

Posted on 1998-03-18
7
Medium Priority
?
484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

730 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