Hi all
My mta, Mailtraq <http://www.mailtraq.com/>, contains a custom
active-x control which can be accessed only when it is running as
an application, not as a service. If Mailtraq is started as a
service, its normal mode, the active-x control can't be instanced
in perl or javascript ...
| test.js
| var mailtraq = new ActiveXObject("Mailtraq.Control");
| WScript.Echo(mailtraq.Config.UserCount);
| c:\scripts> cscript test.js
| Microsoft (R) Windows Script Host Version 5.6
| Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
|
| c:\scripts\test.js(2, 1) Microsoft JScript runtime error: Automation server
can't create object
We, the Mailtraq developer and I, are assuming that this is a
permissions problems but we can't get to the bottom of it. If
anyone has encountered similar problems, we'd appreciate some
pointers in the right direction.
Scripts, both perl and javascript, can access the control if they
are run from a cmd prompt with system account privileges. The
only way I know to achieve that is to exploit a bug in the win2k
scheduler. At the time specified ...
| c:\scripts> at 1:25 /interactive cmd
| Added a new job with job ID = 1
... a cmd window pops up with system account privileges ...
| Microsoft Windows 2000 [Version 5.00.2195]
| (C) Copyright 1985-2000 Microsoft Corp.
|
| C:\WINNT\system32>
... and then scripts, both perl and javascript ...
| # test-ole.pl
| use Win32::OLE;
| use strict;
| use warnings;
|
| my $mtq = Win32::OLE -> new('Mailtraq.Control');
| die "Error: ", Win32::OLE -> LastError(), "\n" unless $mtq;
|
| my $count = $mtq -> Config -> UserCount;
| print "$count\n";
... can instance the control without problems ...
| C:\WINNT\system32> perl test-ole.pl
| 42
If the core problem can't be fixed, is there a better, safer way
of gaining system account status within a perl script?
--
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs