We help IT Professionals succeed at work.

Get content DB sizes via SharePoint 2010 Management Shell?

jessc7
jessc7 asked
on
Is it possible to get a list of content databases within a web app and their sizes through the SharePoint 2010 Management Shell on SharePoint Foundation?
Comment
Watch Question

Commented:
You can try something like this:

Get-SPWebApplication | ForEach {$_.ContentDatabases} | Select Name

Not sure if you can get the size from the contentdatabase object. You should be able to get ContentDatabase.DiskSizeRequired which is the amount of space needed for backing it up (which includes the log file)

Or give this a try - http://www.thesug.org/blogs/lsuslinky/SSM/Pages/default.aspx

Author

Commented:
DiskSizeRequired is close enough, based on the database size I see in SQL Server Management Studio. Thanks!