Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Anyone know how I might get the current mailbox space usage of an Exchange 2003 account from the command line?

I can get the quotas using ldapsearch and a filter, but the current usage doesn't seem to be in ldap...

I can always export the usage from the exchange system manager, but then am not sure what to 'join' on in a script other than the 'mailbox' field, but I don't know where that comes from, and it would be easier not to make the join have to be some sort of fuzzy logic....

share|improve this question
add comment

2 Answers

There are really 2 ways to get the mailbox database size from Exchange 2003

  • The filesystem - looking at the size of the Exchange EDB and Log files
  • Exchange itself using the Exchange Console or Powershell (yes you can use Powershell for Exchange 2003)

I have a PowerShell script for Exchange 2003 that will get you the mailbox sizes, but obviously this is a Windows solution, so I'm not sure of any way you could call it remotely from linux.

This is the Powershell script that will get you the size of the EDB adn STM files:

$server = “ATS-Exch301″ # Give Server Name Here

foreach ($DB in get-mailboxdatabase -server $server)
{
$DBEDBPath = “name=’” + $DB.EdbFilePath.ToString().Replace(”\”,”\\”) + “‘”

$DBSTMPath = $DBEDBPath.replace(”edb”,”stm”)

$DBEDBSize = (get-wmiobject CIM_Datafile -filter $DBEDBPath -ComputerName $Server).filesize
$DBSTMSize = (get-wmiobject CIM_Datafile -filter $DBSTMPath -ComputerName $Server).filesize


$DBEDBSize = $DBEDBSize / 1MB
$DBSTMSize = $DBSTMSize / 1MB

Write-host $DB.identity `t $DBEDBSize `t $DBSTMSize

}

If you can get that to run with PSExec, you should get what you need.

share|improve this answer
    
See this question (serverfault.com/questions/69692/…) for a psexec alternative that can be used from Linux. –  Zoredache Oct 13 '09 at 16:22
add comment

What about querying via IMAP?

You can perhaps use Perl for this (and use ssl-encryption).
Net::IMAP::Simple
IMAP::Client
Quotas aren't mentioned in the first link here. The second link should help you.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.