{"id":1143,"date":"2012-10-16T09:47:55","date_gmt":"2012-10-16T09:47:55","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1143"},"modified":"2024-04-26T12:42:15","modified_gmt":"2024-04-26T12:42:15","slug":"output-site-collection-and-storage-information","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/output-site-collection-and-storage-information\/","title":{"rendered":"Output Site Collection and storage information"},"content":{"rendered":"<h4>Reporting on Site Collection and storage information<\/h4>\n<p>Wouldn\u2019t it be nice to have a single report of Site Collections, the Content Database each is in, and the size in GB? Well, let\u2019s do it!<\/p>\n<p>First let\u2019s grab the Web Application:<\/p>\n<pre lang=\"php\">   get-spwebapplication http :\/\/SharePoint \r\n \r\nThen we grab the Site Collections (all of them):\r\n[sourcecode language=\"powershell\"]\r\nGet-SPSite -Limit all  \r\n\r\n<\/pre>\n<p>Now, let\u2019s select the information we want to see in the report:<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"powershell plain\">select url,contentdatabase<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre lang=\"php\"> select url,contentdatabase,@{label=\"Size in GB\";Expression={$_.usage.storage\/1GB}} \r\n<\/pre>\n<p>Now, let\u2019s output the report to a CSV file, making it easy to read in Excel:<\/p>\n<pre lang=\"php\">  convertto-csv | set-content \"L:PowerShellDBsize.csv\"\r\n<\/pre>\n<p>Now let\u2019s put it all together in a single command, piping the commands to produce the report:<\/p>\n<pre lang=\"php\"> get-spwebapplication http :\/\/SharePoint | Get-SPSite -Limit all | select url,contentdatabase,@{label=\"Size in GB\";Expression={$_.usage.storage\/1GB}} | convertto-csv | set-content \"L:PowerShellDBsize.csv\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Reporting on Site Collection and storage information Wouldn\u2019t it be nice to have a single report of Site Collections, the Content Database each is in, and the size in GB? Well, let\u2019s do it! First let\u2019s grab the Web Application: get-spwebapplication http :\/\/SharePoint Then we grab the Site Collections (all of them): [sourcecode language=&#8221;powershell&#8221;] Get-SPSite [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":1151,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-performance"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1143"}],"version-history":[{"count":2,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1143\/revisions"}],"predecessor-version":[{"id":1157,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1143\/revisions\/1157"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1151"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}