Get Mailbox Quota information from Exchange 2003

I wrote the script below to get all the mailbox quota information from all my users.  It loads the Quest ActiveRoles snappin if it doesn’t already exist, and created a .log file with all the data.  It is a |-separated file.

Write-Host “Checking ActiveRoles Snapin”
if (Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction silentlycontinue) {Write-Host “Added ActiveRoles Snapin”} Else {Write-Host “Snapin present.”}
Remove-Item “mbxquotas.log”
$logfile = New-Item “mbxquotas.log” -Type file
Add-Content $logfile “UserName|mDBStorageQuota|mDBOverQuotaLimit|mDBOverHardQuotaLimit|homeMDB”
$users = Get-QADUser -Sizelimit 0
$users | foreach
  {$user = get-qaduser $_
   $datastring = $ + “|” + $user.mdbstoragequota + “|” + $user.mdboverquotalimit + “|” + $user.mdboverhardquotalimit + “|” + $user.homemdb
   Add-Content $logfile -Value $datastring


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s