Actually, you can get to some of that information via WMI.
Here's an example in Perl that I'd put together for a similar purpose:
#! /usr/bin/env perl
use strict;
use warnings;
use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;
print "Mailbox,Size (KB),Total Items,Last Logon Time,Last User\n";
my @computers = qw ( mailserver1 mailserver2 etc); #array off all mail servers, separated by spaces
foreach my $computer (@computers) {
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\MicrosoftExchangeV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Exchange_Mailbox", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
foreach my $objItem (in $colItems) {
my $mailboxDisplayName = $objItem->{MailboxDisplayName} || "NULL";
my $size = $objItem->{Size} || "NULL";
my $totalItems = $objItem->{TotalItems} || "NULL";
my $lastLogonTime = substr($objItem->{LastLogonTime},0,8) || "NULL";
my $lastUser = $objItem->{LastLoggedOnUserAccount} || "NULL";
#next unless $mailboxDisplayName;
print "$mailboxDisplayName,$size,$totalItems,$lastLogonTime,$lastUser\n";
}
}
You need perl installed and the Win32::OLE module, but it's pretty easy. Run it from the command line by executing perl scriptname.pl
, and capture to a .csv file by running perl scriptname.pl > report.csv
This WMI Class can't get you Attachment info, but it can give you the number of messages and the mailbox size.