Re: Win32::Ole (MAPI) and Win2K scheduler
Christopher Taranto wrote: Hi Ken, Wednesday, January 4, 2006, 5:07:58 AM, you wrote: LK> Thanks to Steven Manross, I'm a step further along in LK> troubleshooting this. Using Steven's suggestion, I got the LK> following from OLE->LastError: 'Win32::OLE(0.1403) error LK> 0x80070005: "Access is denied"'. Does anyone out there know LK> anything about how the Win2k scheduler accesses objects (and, more LK> importantly, how to circumvent this problem)? As I stated LK> earlier, the scheduled task is running under the same userid I use LK> to log on when I successfully run my program at a command prompt. [% snip %] LK> I created a program using ActiveState's perl 5.8.4, compiled it using LK> perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against LK> Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command LK> prompt and as a scheduled task. I released it into production on LK> Windows 2000 server SP4 using the identical version of Outlook 2000. LK> Again, it runs great from a command prompt. When I run it as a LK> scheduled task, however, it dies because it's not able to get the LK> Outlook Application. I also had problems on Win2k SP4 running Perl scripts via scheduler that had worked fine from the command prompt. I came to the conclusion that scheduler does not exactly simulate a dos command prompt and things like automatically invoking perl by the suffix .pl didn't work, and I suspect it doesn't use Path either. I had to set the "start in" value to give it a kickoff point. You could try playing with that. LK> LK> Here's the relevant code: LK> LK> LK> Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); LK> die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); LK> eval { $Outlook = LK> Win32::OLE->GetActiveObject('Outlook.Application') LK> }; LK> die "Outlook is not installed" if $@; LK> unless (defined $Outlook) { LK> $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->>Quit;}); LK> or die "Oops, cannot start Outlook"; LK> <=== dies here under Win2k srvr as a scheduled task I'm not sure if this will help or solve your problem - but you could give Outlook Redemption a look - http://www.dimastr.com/redemption/ "Outlook Redemption works around limitations imposed by the Outlook Security Patch and Service Pack 2 of MS Office 98/2000 and Office 2002 and 2003 (which include Security Patch) plus provides a number of objects and functions to work with properties and functionality not exposed through the Outlook object model." Good luck! -- - ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re[2]: Win32::Ole (MAPI) and Win2K scheduler
Hi Ken, Wednesday, January 4, 2006, 5:07:58 AM, you wrote: LK> Thanks to Steven Manross, I'm a step further along in LK> troubleshooting this. Using Steven's suggestion, I got the LK> following from OLE->LastError: 'Win32::OLE(0.1403) error LK> 0x80070005: "Access is denied"'. Does anyone out there know LK> anything about how the Win2k scheduler accesses objects (and, more LK> importantly, how to circumvent this problem)? As I stated LK> earlier, the scheduled task is running under the same userid I use LK> to log on when I successfully run my program at a command prompt. [% snip %] LK> I created a program using ActiveState's perl 5.8.4, compiled it using LK> perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against LK> Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command LK> prompt and as a scheduled task. I released it into production on LK> Windows 2000 server SP4 using the identical version of Outlook 2000. LK> Again, it runs great from a command prompt. When I run it as a LK> scheduled task, however, it dies because it's not able to get the LK> Outlook Application. LK> LK> Here's the relevant code: LK> LK> LK> Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); LK> die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); LK> eval { $Outlook = LK> Win32::OLE->GetActiveObject('Outlook.Application') LK> }; LK> die "Outlook is not installed" if $@; LK> unless (defined $Outlook) { LK> $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->>Quit;}); LK> or die "Oops, cannot start Outlook"; LK> <=== dies here under Win2k srvr as a scheduled task I'm not sure if this will help or solve your problem - but you could give Outlook Redemption a look - http://www.dimastr.com/redemption/ "Outlook Redemption works around limitations imposed by the Outlook Security Patch and Service Pack 2 of MS Office 98/2000 and Office 2002 and 2003 (which include Security Patch) plus provides a number of objects and functions to work with properties and functionality not exposed through the Outlook object model." Good luck! -- Best regards, Christophermailto:[EMAIL PROTECTED] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Win32::Ole (MAPI) and Win2K scheduler
On 1/4/06, LeFevre, Ken <> wrote: > Thanks to Steven Manross, I'm a step further along in troubleshooting this. > Using Steven's suggestion, I got the following from OLE->LastError: > 'Win32::OLE(0.1403) error 0x80070005: "Access is denied"'. Does anyone out > there know anything about how the Win2k scheduler accesses objects (and, more > importantly, how to circumvent this problem)? As I stated earlier, the > scheduled task is running under the same userid I use to log on when I > successfully run my program at a command prompt. > > Ken > -Original Message- > From: Steven Manross [] > Sent: Tuesday, January 03, 2006 5:18 PM > To: LeFevre, Ken; > Subject: RE: Win32::Ole (MAPI) and Win2K scheduler > > > Replace : > > die "Oops, cannot start Outlook"; > > with > > open (FILE,">>c:\\outlookerror.txt"); > print FILE "Oops, cannot start Outlook\n".Win32::OLE->LastError(); > close (FILE); > die "Oops, cannot start Outlook"; > > It will help refine what error the script is throwing (and refine the > possible solutions to the problem). > > Steven > > > From: > [mailto:] On Behalf Of > LeFevre, Ken > Sent: Tuesday, January 03, 2006 1:01 PM > To: > Subject: Win32::Ole (MAPI) and Win2K scheduler > > > I created a program using ActiveState's perl 5.8.4, compiled it using > perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against > Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command > prompt and as a scheduled task. I released it into production on > Windows 2000 server SP4 using the identical version of Outlook 2000. > Again, it runs great from a command prompt. When I run it as a > scheduled task, however, it dies because it's not able to get the > Outlook Application. > > Here's the relevant code: > > >Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); >die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); >eval { $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') > }; >die "Outlook is not installed" if $@; >unless (defined $Outlook) { >$Outlook = Win32::OLE->new('Outlook.Application', sub > {$_[0]->Quit;}); >or die "Oops, cannot start Outlook"; > <=== dies here under Win2k srvr as a scheduled task > > As best I can tell, Outlook is registered the same on both machines. > The same dlls exist on both. I even set up the scheduled task to run > under the same userid I used when logging on to the server to run the > program from the command prompt. My theory is that there is some sort > of permissions issue or a difference in the scheduled task environment > between the two versions of the Win2k OS, but I'm not succeeded at > finding the problem and how to resolve it. > > I would greatly appreciate any insight or assistance in getting this to > run in the new environment. > > Thanks, > > Ken > > ___ > Perl-Win32-Users mailing list > Perl-Win32-Users@listserv.ActiveState.com > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > Try going into Administrative Tools => Local Security Settings => User Rights Assignment and experiment with the 'Log on as a batch job' and 'Log on as a service' settings. -Jason ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::Ole (MAPI) and Win2K scheduler
Thanks to Steven Manross, I'm a step further along in troubleshooting this. Using Steven's suggestion, I got the following from OLE->LastError: 'Win32::OLE(0.1403) error 0x80070005: "Access is denied"'. Does anyone out there know anything about how the Win2k scheduler accesses objects (and, more importantly, how to circumvent this problem)? As I stated earlier, the scheduled task is running under the same userid I use to log on when I successfully run my program at a command prompt. Ken -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 03, 2006 5:18 PM To: LeFevre, Ken; perl-win32-users@listserv.ActiveState.com Subject: RE: Win32::Ole (MAPI) and Win2K scheduler Replace : die "Oops, cannot start Outlook"; with open (FILE,">>c:\\outlookerror.txt"); print FILE "Oops, cannot start Outlook\n".Win32::OLE->LastError(); close (FILE); die "Oops, cannot start Outlook"; It will help refine what error the script is throwing (and refine the possible solutions to the problem). Steven From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LeFevre, Ken Sent: Tuesday, January 03, 2006 1:01 PM To: perl-win32-users@listserv.ActiveState.com Subject: Win32::Ole (MAPI) and Win2K scheduler I created a program using ActiveState's perl 5.8.4, compiled it using perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command prompt and as a scheduled task. I released it into production on Windows 2000 server SP4 using the identical version of Outlook 2000. Again, it runs great from a command prompt. When I run it as a scheduled task, however, it dies because it's not able to get the Outlook Application. Here's the relevant code: Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); eval { $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') }; die "Outlook is not installed" if $@; unless (defined $Outlook) { $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;}); or die "Oops, cannot start Outlook"; <=== dies here under Win2k srvr as a scheduled task As best I can tell, Outlook is registered the same on both machines. The same dlls exist on both. I even set up the scheduled task to run under the same userid I used when logging on to the server to run the program from the command prompt. My theory is that there is some sort of permissions issue or a difference in the scheduled task environment between the two versions of the Win2k OS, but I'm not succeeded at finding the problem and how to resolve it. I would greatly appreciate any insight or assistance in getting this to run in the new environment. Thanks, Ken ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::Ole (MAPI) and Win2K scheduler
You can get around this popup box in Outlook XP with this "fix" Actually it's a security setting that says that x user is allowed to run programatically.. You'll need Exchange Admin rights to install it in a Public Folder. So, this may or may not help you. It's actually a security risk to enable this, but so is running an old Outlook release, so choose your poison.. http://support.microsoft.com/default.aspx?scid=kb;EN-US;290499 http://office.microsoft.com/en-us/assistance/HA011362851033.aspx http://download.microsoft.com/download/OfficeXPProf/Install/5.0.2920.0.1 /W98NT42KMe/EN-US/ADMPACK.EXE I set it up once so I could help again if needed, but it's been a long long time.. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Foo Ji-Haw Sent: Tuesday, January 03, 2006 7:46 PM To: LeFevre, Ken Cc: perl-win32-users@listserv.ActiveState.com Subject: Re: Win32::Ole (MAPI) and Win2K scheduler LeFevre, Ken wrote: > I created a program using ActiveState's perl 5.8.4, compiled it using > perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against > Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command > prompt and as a scheduled task. I released it into production on > Windows 2000 server SP4 using the identical version of Outlook 2000. > Again, it runs great from a command prompt. When I run it as a > scheduled task, however, it dies because it's not able to get the > Outlook Application. Hi there, I'm afraid I have no solution to your problem, but if you've found help, please share with me, as I code to access Outlook as well. One of the (unrelated) Outlook issues that I deal with, is that with the latest Outlook, the user is prompted to grant access to the Perl application, when the application starts. Some kind of security measure on Microsoft's part, but it does not happen for Outlook 2000. > > Here's the relevant code: > > > Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); > die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); > eval { $Outlook = > Win32::OLE->GetActiveObject('Outlook.Application') }; > die "Outlook is not installed" if $@; > unless (defined $Outlook) { > $Outlook = Win32::OLE->new('Outlook.Application', sub > {$_[0]->Quit;}); > or die "Oops, cannot start Outlook"; > <=== dies here under Win2k srvr as a scheduled > task > > As best I can tell, Outlook is registered the same on both machines. > The same dlls exist on both. I even set up the scheduled task to run > under the same userid I used when logging on to the server to run the > program from the command prompt. My theory is that there is some sort > of permissions issue or a difference in the scheduled task environment > between the two versions of the Win2k OS, but I'm not succeeded at > finding the problem and how to resolve it. > > I would greatly appreciate any insight or assistance in getting this > to run in the new environment. > > Thanks, > > Ken > >--- >- > >___ >Perl-Win32-Users mailing list >Perl-Win32-Users@listserv.ActiveState.com >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Win32::Ole (MAPI) and Win2K scheduler
LeFevre, Ken wrote: I created a program using ActiveState's perl 5.8.4, compiled it using perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command prompt and as a scheduled task. I released it into production on Windows 2000 server SP4 using the identical version of Outlook 2000. Again, it runs great from a command prompt. When I run it as a scheduled task, however, it dies because it's not able to get the Outlook Application. Hi there, I'm afraid I have no solution to your problem, but if you've found help, please share with me, as I code to access Outlook as well. One of the (unrelated) Outlook issues that I deal with, is that with the latest Outlook, the user is prompted to grant access to the Perl application, when the application starts. Some kind of security measure on Microsoft's part, but it does not happen for Outlook 2000. Here's the relevant code: Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); eval { $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') }; die "Outlook is not installed" if $@; unless (defined $Outlook) { $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;}); or die "Oops, cannot start Outlook"; <=== dies here under Win2k srvr as a scheduled task As best I can tell, Outlook is registered the same on both machines. The same dlls exist on both. I even set up the scheduled task to run under the same userid I used when logging on to the server to run the program from the command prompt. My theory is that there is some sort of permissions issue or a difference in the scheduled task environment between the two versions of the Win2k OS, but I'm not succeeded at finding the problem and how to resolve it. I would greatly appreciate any insight or assistance in getting this to run in the new environment. Thanks, Ken ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::Ole (MAPI) and Win2K scheduler
Replace : die "Oops, cannot start Outlook"; with open (FILE,">>c:\\outlookerror.txt"); print FILE "Oops, cannot start Outlook\n".Win32::OLE->LastError(); close (FILE); die "Oops, cannot start Outlook"; It will help refine what error the script is throwing (and refine the possible solutions to the problem). Steven From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LeFevre, Ken Sent: Tuesday, January 03, 2006 1:01 PM To: perl-win32-users@listserv.ActiveState.com Subject: Win32::Ole (MAPI) and Win2K scheduler I created a program using ActiveState's perl 5.8.4, compiled it using perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command prompt and as a scheduled task. I released it into production on Windows 2000 server SP4 using the identical version of Outlook 2000. Again, it runs great from a command prompt. When I run it as a scheduled task, however, it dies because it's not able to get the Outlook Application. Here's the relevant code: Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); eval { $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') }; die "Outlook is not installed" if $@; unless (defined $Outlook) { $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;}); or die "Oops, cannot start Outlook"; <=== dies here under Win2k srvr as a scheduled task As best I can tell, Outlook is registered the same on both machines. The same dlls exist on both. I even set up the scheduled task to run under the same userid I used when logging on to the server to run the program from the command prompt. My theory is that there is some sort of permissions issue or a difference in the scheduled task environment between the two versions of the Win2k OS, but I'm not succeeded at finding the problem and how to resolve it. I would greatly appreciate any insight or assistance in getting this to run in the new environment. Thanks, Ken ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Win32::Ole (MAPI) and Win2K scheduler
I created a program using ActiveState's perl 5.8.4, compiled it using perlapp 5.3.0 and ran it on Windows 2000 Professional SP4 against Outlook 2000 SR-1 (9.0.0.3821). It runs properly both from a command prompt and as a scheduled task. I released it into production on Windows 2000 server SP4 using the identical version of Outlook 2000. Again, it runs great from a command prompt. When I run it as a scheduled task, however, it dies because it's not able to get the Outlook Application. Here's the relevant code: Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); die Win32::OLE->LastError(),"\n" if Win32::OLE->LastError( ); eval { $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') }; die "Outlook is not installed" if $@; unless (defined $Outlook) { $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;}); or die "Oops, cannot start Outlook"; <=== dies here under Win2k srvr as a scheduled task As best I can tell, Outlook is registered the same on both machines. The same dlls exist on both. I even set up the scheduled task to run under the same userid I used when logging on to the server to run the program from the command prompt. My theory is that there is some sort of permissions issue or a difference in the scheduled task environment between the two versions of the Win2k OS, but I'm not succeeded at finding the problem and how to resolve it. I would greatly appreciate any insight or assistance in getting this to run in the new environment. Thanks, Ken ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs