Wednesday, October 3, 2012

Get Content DB Size of all Content DBs as "Report"

Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue 
$cdbs = get-spcontentdatabase
$sum = 0
Write-host "****************************************************" -foregroundcolor white
foreach ($cdb in $cdbs)
 {
 $size = [System.Math]::round(($cdb.DiskSizeRequired/1024/1024/1024),2)
 write-host $size "GB" "--->" $cdb.name   -foregroundcolor green
 $sum = $sum + $cdb.DiskSizeRequired
 }
Write-host "****************************************************" -foregroundcolor white
write-host "Total Space Used:" ($sum/1024/1024/1024/1024)"TB"  -foregroundcolor red
write-host "Total Space Used:" ($sum/1024/1024/1024)"GB"  -foregroundcolor red
Write-host "****************************************************" -foregroundcolor White

1 comment:

  1. Excellent website. Plеnty of hеlрful іnfo heгe.
    I'm sending it to some buddies ans also sharing in delicious. And of course, thank you to your effort!
    my web site :: forearm forklift product

    ReplyDelete