RE: Exchange 2003 replica list via WMI
Ken Cornetet <[email protected]>
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <DF6A68E27C9C734592018E2317E9583606852A791A@nts532.kii.kimball.com> |
Use Data::Dumper; Blah Blah Blah Print Dumper($ReplicaList); -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Conor Lillis Sent: Thursday, July 22, 2010 9:42 AM To: [email protected] 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\\MicrosoftExchangeV2")|| 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 [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs