Powershell to get the Size of all the Exchange Database on all the Mailbox Server

rated by 0 users
This post has 0 Replies | 1 Follower

Top 25 Contributor
Posts 211
Top Contributor
Krishna Posted: 01-30-2010 1:27 PM

$MailboxSvr = Get-MailboxServer | select name
foreach($svr in $mailboxsvr)
 {
  $db = Get-MailboxDatabase -Server $svr.Name
 
  foreach($database in $db)
   {
    $Server = $database.Server.Name
    $Db = $database.Identity
    $edbfilepath = $database.EdbFilePath
 
    $path = “`\`\” + $Server + “`\” + $edbfilepath.DriveName.Remove(1) + “$”+ $edbfilepath.PathName.Remove(0,2)
    $Dbsize =  get-item $path |select-object length
    $K = $Server + ” ” + $Db + ” ” + $Dbsize.Length
    if ($i -eq 0 )
     {
    
     $edbsize = $Dbsize.Length
     Write-host $database + " - " + $edbsize
 
  }
   
          
   }
   
   
 }

 

Page 1 of 1 (1 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.