[Script Of August 6] Get the information of used/free space of all databases in a SQL Server instance

imageimage
Aug.
6
imagehttps://gallery.technet.microsoft.com/How-to-get-the-information-c5b047ed.  You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.

This PowerShell script will demo how to get the information of used or free space of all SQL Server databases in an instance.

As some people asked how to get the used or free space of all databases in a SQL Server, this script will demo how to get the following information:

  • total size of data file(s)
  • total size of log file(s)
  • used space size of data file(s) +log file(s)
  • free space size of data file(s) + log file(s)
  • size of every data file and log file

 

You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery