This blog is by design...

Thursday, August 18, 2005

Another Mailbox Size Mod

Per request, this one just prints the down and dirty, mailbox name and size. This works on Ex2003 only.

On Error Resume Next
'Written to a file instead of Echoed on the screen

set objReadFSO = CreateObject ("Scripting.FileSystemObject")
set objOutputFile = objReadFSO.CreateTextFile("c:\Mailboxes.txt")

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _

Set colItems = objWMIService.ExecQuery _
("Select * from Exchange_Mailbox")

For Each objItem in colItems

objOutputFile.Writeline objItem.MailboxDisplayName & _
"," & objItem.Size



set objReadFSO = Nothing
set objOutputFile = Nothing
Set objWMIService = Nothing
Set colItems = Nothing

Wscript.Echo "All Done"


  • I read your blog, and i thought it was rather cool. check out My Blog
    Please Click Here to view it

    Have a great day.

    By Blogger lennyfrie22144857, at 3:41 PM  

  • Perfect little script.
    Just what I needed. Nothing fancy, but very functional.



    By Anonymous Anonymous, at 4:08 PM  

Post a Comment

<< Home