Accessing Win32 remote scheduled tasks
Accessing Win32 remote scheduled tasks
am 21.12.2007 22:18:32 von kingskippus
Hey all, I'm trying to list the scheduled tasks on Windows servers. I
snagged the Win32::TaskScheduler package, and quickly wrote up the
following code:
my $scheduler=Win32::TaskScheduler->New();
$scheduler->SetTargetComputer("\\\\" . $computer);
my @jobs = $scheduler->Enum();
Locally, logged in as myself, it works like a charm. However, if I
put that in a script on an IIS server we're running, it bombs out on
the SetTargetComputer line. I'm pretty sure the problem is with the
permissions. IIS runs scripts as the local IUSR_(servername) account,
which doesn't have access to resources on remote servers.
I'm using integrated Windows authentication in IIS. Ideally, I
suppose I'd like the script to run with the same permissions as the
user who is accessing the site, so that it would have access to
whatever remote resources the user pulling up the web page has.
Does anyone know if this is possible? If not, does anyone know of a
workaround to accessing remote resources that doesn't involve changing
the permissions on the remote server?
Re: Accessing Win32 remote scheduled tasks
am 21.12.2007 22:28:44 von kingskippus
On Dec 21, 4:18 pm, TonyV wrote:
> Does anyone know if this is possible? If not, does anyone know of a
> workaround to accessing remote resources that doesn't involve changing
> the permissions on the remote server?
Crap, this might help. I'm using ActiveState Perl 5.8.8, build 820
[274739], and the server is IIS 6 running on a Windows 2003 box.
(I've got a really nasty cold right now, which is my excuse for not
posting this in the original message.)
Re: Accessing Win32 remote scheduled tasks
am 21.12.2007 23:11:48 von Thrill5
This is a COM security problem, not an issue with your Perl program. (The
Win32:: modules all make calls to Windows COM components)
The following Google search
http://www.google.com/search?hl=en&q=IIS+running+scripts+as+ authenticated+user
found this interesting article http://forums.iis.net/t/1002416.aspx that
could be the problem you are running into.
"TonyV" wrote in message
news:cdaf9b37-e6fb-404b-9988-02edb2afd454@t1g2000pra.googleg roups.com...
> On Dec 21, 4:18 pm, TonyV wrote:
>> Does anyone know if this is possible? If not, does anyone know of a
>> workaround to accessing remote resources that doesn't involve changing
>> the permissions on the remote server?
>
> Crap, this might help. I'm using ActiveState Perl 5.8.8, build 820
> [274739], and the server is IIS 6 running on a Windows 2003 box.
> (I've got a really nasty cold right now, which is my excuse for not
> posting this in the original message.)
Re: Accessing Win32 remote scheduled tasks
am 21.12.2007 23:37:10 von veatchla
TonyV wrote:
> On Dec 21, 4:18 pm, TonyV wrote:
>> Does anyone know if this is possible? If not, does anyone know of a
>> workaround to accessing remote resources that doesn't involve changing
>> the permissions on the remote server?
>
> Crap, this might help. I'm using ActiveState Perl 5.8.8, build 820
> [274739], and the server is IIS 6 running on a Windows 2003 box.
> (I've got a really nasty cold right now, which is my excuse for not
> posting this in the original message.)
One possible workaround may be to map a drive letter using a user
account with elevated rights to the remote server (Win32::NetResource).
Then access the remote scheduled tasks. Consider security issues this
may cause.
--
Len