ImageMagick with Win32::OLE not working on Windows 2008 64bit

ImageMagick with Win32::OLE not working on Windows 2008 64bit

am 21.07.2010 15:52:09 von heni

Hello everyone

We have a webapplication that uses ImageMagick to do some image transitions=
and resizing. It works on our older servers but now I can't get it to work=
on our Windows 2008 (64 bit) servers.

I've installed the latest (and tried an older that is identical to the one =
on the old servers) ImageMagick binary and remembered to have it register i=
t's dll. When I look in the registry the dll is registered as "ImageMagickO=
bject.MagickImage.1"

When I run Win32::OLE->new("ImageMagickObject.MagickImage.1") I get nothing=
.. The error / warning I can get out is

Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be fo=
und"

We are using Perl 5.10.1 1007 (32 bit)

Does anyone have a suggestion as to what I should do to get it working?


Best regards
Henning Michael M=F8ller Just


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Exchange 2003 replica list via WMI

am 22.07.2010 15:42:14 von Conor Lillis

Hi all,
I am hoping for some assistance in trying to enumerate Exchange 2003
public folder replication partners using Perl and WMI. I can enumerate
all information I am trying to retrieve except the ReplicaList property,
and can see that the query returns data, but when I try to enumerate it
I get no usable output.
I have included my snippet below, and the output below that.

foreach my $host(sort @hosts)
{
chomp($host);
print "\n".gmtime()."\tRetrieving Public folder sizes on
$host\n";
my $OLECon =
Win32::OLE->GetObject("winmgmts:\\\\$host\\root\\MicrosoftEx changeV2")||
die "Cannot access WMI on remote machine: $host",Win32::OLE-LastError;
my $PublicFolders = $OLECon->ExecQuery("Select * From
Exchange_PublicFolder") or die "WMI Query Failed!\n";
foreach my $PublicFolder(in $PublicFolders)
{
$PF1=$PublicFolder->AddressBookName;
$PF2=$PublicFolder->TotalMessageSize/1024;
$PF3=$PublicFolder->MessageCount;
$PF4=$PublicFolder->Path;
my $ReplicaList = $PublicFolder->ReplicaList;
my $ReplicaList = $PublicFolder->ReplicaList;
print "Replica Array = $ReplicaList\n"; # Treat as
text
foreach my $replica(@ReplicaList ) {print "Replica
$replica\n";} # Treat as array
foreach my $key(sort keys %ReplicaList) {print "Key is
$key\tValue is $ReplicaList{$key}\n";} # Treat as hash
}
}
exit;


Thu Jul 22 12:53:01 2010 Retrieving Public folder sizes on
[Exchange server]
Thu Jul 22 12:59:07 2010 Working on pub folder [public folder]
Replica Array = ARRAY(0x9ead7d4)


************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. This e-mail and any files and attachments transmitted with it are unencrypted unless specifically advised otherwise. If you have received this e-mail or any file or attachment transmitted with it in error please
notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone no: +353-1-6162000.
Directors: A.M. Dukes Chairman, A.M.R. Aynsley (Australian) Chief Executive, N. Cawley, A. Eames, M.A. Keane, P.G. Kennedy
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulator. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Private Banking) is regulated by the Financial Regulator. Anglo Irish Assurance Company Limited is regulated by the Financial Regulator.
************************************************************ **********
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Exchange 2003 replica list via WMI

am 22.07.2010 16:38:13 von Brian Raven

Conor Lillis <> wrote:
> Hi all,
> I am hoping for some assistance in trying to enumerate Exchange 2003
> public folder replication partners using Perl and WMI. I can
> enumerate all information I am trying to retrieve except the
> ReplicaList property, and can see that the query returns data, but
> when I try to enumerate it I get no usable output.
> I have included my snippet below, and the output below that.
>
> foreach my $host(sort @hosts)
> {
> chomp($host);
> print "\n".gmtime()."\tRetrieving Public folder sizes on
$host\n";
> my $OLECon =
>
Win32::OLE->GetObject("winmgmts:\\\\$host\\root\\MicrosoftEx changeV2")||
> die "Cannot access WMI on remote machine: $host",Win32::OLE-LastError;
> my $PublicFolders = $OLECon->ExecQuery("Select * From
> Exchange_PublicFolder") or die "WMI Query Failed!\n";
> foreach my $PublicFolder(in $PublicFolders)
> {
> $PF1=$PublicFolder->AddressBookName;
> $PF2=$PublicFolder->TotalMessageSize/1024;
> $PF3=$PublicFolder->MessageCount;
> $PF4=$PublicFolder->Path;
> my $ReplicaList = $PublicFolder->ReplicaList;
> my $ReplicaList = $PublicFolder->ReplicaList;
> print "Replica Array = $ReplicaList\n"; # Treat as
> text
> foreach my $replica(@ReplicaList ) {print "Replica
> $replica\n";} # Treat as array
> foreach my $key(sort keys %ReplicaList) {print "Key is
> $key\tValue is $ReplicaList{$key}\n";} # Treat as hash
> }
> }
> exit;
>
>
> Thu Jul 22 12:53:01 2010 Retrieving Public folder sizes on
> [Exchange server]
> Thu Jul 22 12:59:07 2010 Working on pub folder [public folder]
> Replica Array = ARRAY(0x9ead7d4)

That is telling you that you have a reference to an array, so you need
to dereference it. Try the following:

foreach my $replica(@$ReplicaList ) {
# ^
print "Replica $replica\n";
}

See 'perldoc -f perlreftut' and 'perldoc perlref'.

Also, your code suggests that you may not have 'use strict;' at the
start of your script, at least the code you supply would not compile if
it was there. It's a good idea to always to have that, and 'use
warnings;' at the start of every script.

HTH

--
Brian Raven

Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Exchange 2003 replica list via WMI

am 22.07.2010 16:39:56 von Brian Raven

Brian Raven <> wrote:
> Conor Lillis <> wrote:
>> Hi all,
>> I am hoping for some assistance in trying to enumerate Exchange 2003
>> public folder replication partners using Perl and WMI. I can
>> enumerate all information I am trying to retrieve except the
>> ReplicaList property, and can see that the query returns data, but
>> when I try to enumerate it I get no usable output.
>> I have included my snippet below, and the output below that.
>>
>> foreach my $host(sort @hosts)
>> {
>> chomp($host);
>> print "\n".gmtime()."\tRetrieving Public folder sizes on
$host\n";
>> my $OLECon =
>>
>
Win32::OLE->GetObject("winmgmts:\\\\$host\\root\\MicrosoftEx changeV2")||
>> die "Cannot access WMI on remote machine:
>> $host",Win32::OLE-LastError; my $PublicFolders =
>> $OLECon->ExecQuery("Select * From Exchange_PublicFolder") or die
>> "WMI Query Failed!\n"; foreach my $PublicFolder(in
$PublicFolders)
>> {
>> $PF1=$PublicFolder->AddressBookName;
>> $PF2=$PublicFolder->TotalMessageSize/1024;
>> $PF3=$PublicFolder->MessageCount;
>> $PF4=$PublicFolder->Path;
>> my $ReplicaList = $PublicFolder->ReplicaList;
>> my $ReplicaList = $PublicFolder->ReplicaList;
>> print "Replica Array = $ReplicaList\n"; # Treat as
>> text
>> foreach my $replica(@ReplicaList ) {print "Replica
>> $replica\n";} # Treat as array
>> foreach my $key(sort keys %ReplicaList) {print "Key is
>> $key\tValue is $ReplicaList{$key}\n";} # Treat as hash
}
>> }
>> exit;
>>
>>
>> Thu Jul 22 12:53:01 2010 Retrieving Public folder sizes on
>> [Exchange server] Thu Jul 22 12:59:07 2010 Working on pub
>> folder [public folder] Replica Array = ARRAY(0x9ead7d4)
>
> That is telling you that you have a reference to an array, so you
> need to dereference it. Try the following:
>
> foreach my $replica(@$ReplicaList ) {
> # ^
> print "Replica $replica\n";
> }
>
> See 'perldoc -f perlreftut' and 'perldoc perlref'.

Lose the -f. Sorry, must pay attention.

>
> Also, your code suggests that you may not have 'use strict;' at the
> start of your script, at least the code you supply would not compile
> if it was there. It's a good idea to always to have that, and 'use
> warnings;' at the start of every script.
>
> HTH

Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Exchange 2003 replica list via WMI

am 22.07.2010 16:57:23 von Ken Cornetet

Use Data::Dumper;
Blah
Blah
Blah
Print Dumper($ReplicaList);

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Conor Lillis
Sent: Thursday, July 22, 2010 9:42 AM
To: activeperl@listserv.ActiveState.com
Subject: Exchange 2003 replica list via WMI

Hi all,
I am hoping for some assistance in trying to enumerate Exchange 2003
public folder replication partners using Perl and WMI. I can enumerate
all information I am trying to retrieve except the ReplicaList property,
and can see that the query returns data, but when I try to enumerate it
I get no usable output.
I have included my snippet below, and the output below that.

foreach my $host(sort @hosts)
{
chomp($host);
print "\n".gmtime()."\tRetrieving Public folder sizes on
$host\n";
my $OLECon =
Win32::OLE->GetObject("winmgmts:\\\\$host\\root\\MicrosoftEx changeV2")||
die "Cannot access WMI on remote machine: $host",Win32::OLE-LastError;
my $PublicFolders = $OLECon->ExecQuery("Select * From
Exchange_PublicFolder") or die "WMI Query Failed!\n";
foreach my $PublicFolder(in $PublicFolders)
{
$PF1=$PublicFolder->AddressBookName;
$PF2=$PublicFolder->TotalMessageSize/1024;
$PF3=$PublicFolder->MessageCount;
$PF4=$PublicFolder->Path;
my $ReplicaList = $PublicFolder->ReplicaList;
my $ReplicaList = $PublicFolder->ReplicaList;
print "Replica Array = $ReplicaList\n"; # Treat as
text
foreach my $replica(@ReplicaList ) {print "Replica
$replica\n";} # Treat as array
foreach my $key(sort keys %ReplicaList) {print "Key is
$key\tValue is $ReplicaList{$key}\n";} # Treat as hash
}
}
exit;


Thu Jul 22 12:53:01 2010 Retrieving Public folder sizes on
[Exchange server]
Thu Jul 22 12:59:07 2010 Working on pub folder [public folder]
Replica Array = ARRAY(0x9ead7d4)


************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. This e-mail and any files and attachments transmitted with it are unencrypted unless specifically advised otherwise. If you have received this e-mail or any file or attachment transmitted with it in error please
notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone no: +353-1-6162000.
Directors: A.M. Dukes Chairman, A.M.R. Aynsley (Australian) Chief Executive, N. Cawley, A. Eames, M.A. Keane, P.G. Kennedy
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulator. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Private Banking) is regulated by the Financial Regulator. Anglo Irish Assurance Company Limited is regulated by the Financial Regulator.
************************************************************ **********
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs