Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 (…) for a psexec alternative that can be used from Linux. – Zoredache Oct 13 '09 at 16:22

What about querying via IMAP?

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

share|improve this answer

Your Answer


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.