Jump to content
Sign in to follow this  

Exchange report users mailbox size / OU

Recommended Posts


Hi guys,

Good looking scripts.

But too bad it's not what i'm looking for. Maybe someone can help me out but it is realy challenging....

I want to create an report with users and their current mailbox size(not mailbox limits) from exchange. and that for eeach OU.

mind dazzeling huh?

I hope there are some smart people. (iam not from that group ^^)

I can retrieve all users mailbox size with this wmi script. But how can we map them to the ou there are sitting?

Is this possible if there is only one exhange server?

; This code lists the size of all mailboxes on the selected server.

 $strComputerName = "<serverName>"  ; e.g. "batman"
; ------ END CONFIGURATION ---------
  $strE2K3WMIQuery = "winmgmts://" & $strComputerName & "/root/MicrosoftExchangeV2"
  ; Find each $mailbox on the target server and report their
  ; item counts and sizes
   $mboxList = ObjGet($strE2K3WMIQuery)
   $mbox = $mboxList.InstancesOf("Exchange_Mailbox")
  For $mailbox in $mbox
    $strOutput = ""
    $strOutput =  "Mailbox: " & $mailbox.MailboxDisplayName & @CRLF
    $strOutput = $strOutput &  "   " & $mailbox.Size & "KB in " & $mailbox.TotalItems & _
         " items" & @CRLF
    ConsoleWrite ($strOutput & @CRLF)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this