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

Re: Server permission problems and SchAgent by name

name
Mon Aug 16 04:24:15 CDT 2004

Amazing is your setting.

windows, apache, cgi, scheduler, perl.

===========

Looked at you .zip

3 of 4 files agree.

--------------

nr. 4 is the .job and binary as of windows.

Sorry



"tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message
news:%23jU%232UegEHA.2908@TK2MSFTNGP10.phx.gbl...
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.

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.
The info was read back from inside the CGI script
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.

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






Re: Server permission problems and SchAgent by tlviewer

tlviewer
Mon Aug 16 08:39:12 CDT 2004


"name" <nospam@user.com> wrote in message =
news:e3KJOL3gEHA.2856@TK2MSFTNGP10.phx.gbl...
> Amazing is your setting.
>=20
> windows, apache, cgi, scheduler, perl.
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Looked at you .zip
>=20
> 3 of 4 files agree.
>=20
> --------------
>=20
> nr. 4 is the .job and binary as of windows.
>=20
> Sorry

I included the .JOB file so that you can see
how the Pipe client (PLPipe.pl) is "run" from the
Task Scheduler. i.e.,

perl PLPipe.pl \\RemoteServer\MyXLanFile

the TestSchAgent.pl is the Main script which
will read via the Pipe. It can be running under
limited permission (i.e. SYSTEM) and still get
the file read from across the network.

The trick is that the Administrator has to own
PLPipe.pl and setup the PLPipe.job. Only the
commandline parameters to PLPipe.pl are modified by
TestSchAgent.pl via SchAgent.

I posted this to the VBScript/WSH groups so that
the Admins who use a lot of ASP to write utilities
can see how SchAgent can be used to workaround
IIS permissions.=20

--
tlviewer
=20
>=20
>=20
>=20
> "tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message
> news:%23jU%232UegEHA.2908@TK2MSFTNGP10.phx.gbl...
> Hi All,
>=20
> Using Win2k sp3
> Perl 5.8.1
> Apache2
>=20
> I was using a CGI script in an Apache2/Win2k
> network to browse files and filetime info
> on the server and across the network.=20
>=20
> Here's a simple Perl demo
> http://4.11.211.97/PLPipe.zip
>=20
> regards,
> tlviewer
>=20
>=20
>=20
>=20
>

Re: Server permission problems and SchAgent by tlviewer

tlviewer
Mon Aug 16 08:43:28 CDT 2004


"tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message =
news:#5cr0Z5gEHA.636@TK2MSFTNGP12.phx.gbl...

"name" <nospam@user.com> wrote in message =
news:e3KJOL3gEHA.2856@TK2MSFTNGP10.phx.gbl...
> Amazing is your setting.
>=20
> windows, apache, cgi, scheduler, perl.
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Looked at you .zip
>=20
> 3 of 4 files agree.
>=20
> --------------
>=20
> nr. 4 is the .job and binary as of windows.
>=20
> Sorry

I included the .JOB file so that you can see
how the Pipe client (PLPipe.pl) is "run" from the
Task Scheduler. i.e.,

perl PLPipe.pl \\RemoteServer\MyXLanFile

the TestSchAgent.pl is the Main script which
will read via the Pipe. It can be running under
limited permission (i.e. SYSTEM) and still get
the file read from across the network.

The trick is that the Administrator has to own
PLPipe.pl and setup the PLPipe.job. Only the
commandline parameters to PLPipe.pl are modified by
TestSchAgent.pl via SchAgent.

I posted this to the VBScript/WSH groups so that
the Admins who use a lot of ASP to write utilities
can see how SchAgent can be used to workaround
IIS permissions.=20

--
tlviewer
=20
>=20
>=20
>=20
> "tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message
> news:%23jU%232UegEHA.2908@TK2MSFTNGP10.phx.gbl...
> Hi All,
>=20
> Using Win2k sp3
> Perl 5.8.1
> Apache2
>=20
> I was using a CGI script in an Apache2/Win2k
> network to browse files and filetime info
> on the server and across the network.=20
>=20
> Here's a simple Perl demo
> http://4.11.211.97/PLPipe.zip
>=20
> regards,
> tlviewer
>=20
>=20
>=20
>=20
>

Re: Server permission problems and SchAgent by tlviewer

tlviewer
Mon Aug 16 08:44:49 CDT 2004

(correction)
"tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message =
news:#5cr0Z5gEHA.636@TK2MSFTNGP12.phx.gbl...

"name" <nospam@user.com> wrote in message =
news:e3KJOL3gEHA.2856@TK2MSFTNGP10.phx.gbl...
> Amazing is your setting.
>=20
> windows, apache, cgi, scheduler, perl.
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Looked at you .zip
>=20
> 3 of 4 files agree.
>=20
> --------------
>=20
> nr. 4 is the .job and binary as of windows.
>=20
> Sorry

I included the .JOB file so that you can see
how the Pipe client (PLPipe.pl) is "run" from the
Task Scheduler. i.e.,

wperl.exe PLPipe.pl "//RemoteServer/RemoteFile"
(script params should be quoted)

the TestSchAgent.pl is the Main script which
will read via the Pipe. It can be running under
limited permission (i.e. SYSTEM) and still get
the file read from across the network.

The trick is that the Administrator has to own
PLPipe.pl and setup the PLPipe.job. Only the
commandline parameters to PLPipe.pl are modified by
TestSchAgent.pl via SchAgent.

I posted this to the VBScript/WSH groups so that
the Admins who use a lot of ASP to write utilities
can see how SchAgent can be used to workaround
IIS permissions.=20

--
tlviewer
=20
>=20
>=20
>=20
> "tlviewer" <tlviewerSHRUB@yahoo.CHENEY.com> wrote in message
> news:%23jU%232UegEHA.2908@TK2MSFTNGP10.phx.gbl...
> Hi All,
>=20
> Using Win2k sp3
> Perl 5.8.1
> Apache2
>=20
> I was using a CGI script in an Apache2/Win2k
> network to browse files and filetime info
> on the server and across the network.=20
>=20
> Here's a simple Perl demo
> http://4.11.211.97/PLPipe.zip
>=20
> regards,
> tlviewer
>=20
>=20
>=20
>=20
>