Hi All,
Using Win2k sp3
Perl 5.8.1
Apache2
I was using a CGI script in an Apache2/Win2k
network to browse files and filetime info
on the server and across the network. Using
the default account for Apache2, I succeeded
on the web server, but got bad file descriptors
when going across LAN. It was the usual permission
trouble.
Since I was using Perl CGI I ran over to CPAN
and looked for a module to do a CreateProcessWithLogon
or some such beast.
I couldn't get any of several modules to work.
Then I realized that the trusty Scheduler.SchAgent
might be the trick.=20
I ended up using a named pipe. The CGI script
fires a Pipe client (setup as a Scheduled Task) to read
the x-lan file, and write to the named pipe.=20
The info was read back from inside the CGI script=20
running a Pipe server.
The CGI script used the SchAgent object to Activate
the desired Scheduled Task, give it the right command
line, then "Run" it.=20
It works because the web server is running in the
SYSTEM account, and the fired Scheduled Task is running
as the Administrator. I setup the task before hand with
username and password I need, but when I "Run" from CGI
its not necessary to supply the credentials again :)
Here's a simple Perl demo
http://4.11.211.97/PLPipe.zip
regards,
tlviewer