Exchange Server Forums

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

Is there a PS Command that will give the size of all Stores?

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [Microsoft Exchange 2007] >> General >> Is there a PS Command that will give the size of all Stores? Page: [1]
Login
Message << Older Topic   Newer Topic >>
Limited time MSExchange.org offer! -- 1.Sep.2008 1:00:00 PM
TechGenix and SolarWinds have partnered to provide free copies of SolarWinds Exchange Monitor to all visitors who join the MSExchange.org Forums. SolarWinds Exchange Monitor is a handy desktop dashboard that continuously monitors Microsoft Exchange to deliver real-time insight into Exchange services, mail queue sizes, and host server health. Learn more about Exchange Monitor and the free offer!
Is there a PS Command that will give the size of all St... - 4.Oct.2007 6:18:36 AM   
Prodigus

 

Posts: 34
Joined: 5.Feb.2005
From: Texas
Status: offline
I've been trying to create a Powershell command that we can use to retrieve the total size of all databases across all of our mail servers  (12 mail stores in all) for a report that we do each month.

Hs anyone come across what command to use for this?  I started with the get-maildatabase command and was trying some things there bt now I'm starting to wonder if this is just a get-wmiobject thing..
Post #: 1
RE: Is there a PS Command that will give the size of al... - 4.Oct.2007 12:00:51 PM   
John Weber

 

Posts: 620
Joined: 20.Apr.2005
From: Portland, Oregon
Status: offline
What a great question.
I just ran a "get-mailboxdatabase | fl *" and the size of the edb is not even displayed there.
My initial thought is to create either a vbs or a bat that goes and runs a dir for the edb's, and pushes that to a csv file.

If you try for mailbox sizes, there is a similar issue; the mailbox size is reported in literal bytes, complete with a "B" on the end of it.  Outputting to a csv file (for math purposes) results in a text field that excel needs macros to handle.
Dang, I wish I was more of a programmer .
[PS] C:\>get-mailbox | get-mailboxstatistics | FT displayname, itemcount, totalitemsize, servername
DisplayName                             ItemCount TotalItemSize            ServerName
-----------                             --------- -------------            ----------
Administrator                                  18 69809572B                E2K7
bonehead                                       13 34943557B                E2K7
Test User2                                     10 17381B                   E2K7
Test User3                                      1 1242B                    E2K7
Test User4                                      1 1242B                    E2K7
conference rm. 1                                0 0B                       E2K7

-jmw

< Message edited by John Weber -- 4.Oct.2007 12:05:17 PM >

(in reply to Prodigus)
Post #: 2
RE: Is there a PS Command that will give the size of al... - 4.Oct.2007 12:27:25 PM   
Prodigus

 

Posts: 34
Joined: 5.Feb.2005
From: Texas
Status: offline
ok, here's what I came up with....

The following Powershell command  will get you the size of each mail store (I have 12 of them across 2 servers)
 
Get-MailboxDatabase | foreach {get-childitem $_.edbFilePath | select-object name,length} | export-csv c:\dbsize.csv | foreach  {$_.length=($_.length)/1024/1024/1024; $_}
 
The only thing that I can see that would make it better is if you could get it to add them all up and then take some of the decimal places off the end but I guess all of that could be done after the fact…  I still really like seeing the size of each as well.  The decimal places bugs me though...
 
 
There’s one little kicker though… whatever box you run this from has to have drive mappings to the root of  the drives where all the databases reside.  I got this to work on a single server fine but in order to get the report to run on my second serverI had to map the expected drive letters to my second server.  I used my virtual names just in case it had failed over to my 3rd failover box.

(in reply to John Weber)
Post #: 3

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [Microsoft Exchange 2007] >> General >> Is there a PS Command that will give the size of all Stores? Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts