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


image image

Aug.
6
image

Script Download:  
The script is available for download from http://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

Comments (4)

  1. Ed (DareDevil57) says:

    Thanks for sharing.

  2. Interesting script.

    Could be repackaged with the following syntax

    Get-DBSpaceInformation -Name Localhost -ShowWindow $True

    How to execute a SQL query in Powershell (GUI)\
    http://social.technet.microsoft.com/wiki/contents/articles/25718.how-to-execute-a-sql-query-in-powershell-gui.aspx

  3. aw says:

    hai, I just want to tell you that I am just very new to blogs and seriously loved this website. More than likely I’m planning to bookmark your blog post .
    You amazingly come with really good posts. Thanks a lot for sharing your blog Microsoft.

    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Palembang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Papua
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Papua%20Barat
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Pati
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Pekalongan
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Pontianak
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Samarinda
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Semarang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Serang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Sidoarjo
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Surabaya
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Surakarta
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Tasikmalaya
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Yogyakarta
    http://www.lokerjobindo.com/search/label/Loker%20Jurusan%20Akunting
    http://www.lokerjobindo.com/search/label/Loker%20Jurusan%20Asuransi
    http://www.lokerjobindo.com/search/label/Loker%20Jurusan%20Teknologi%20Informasi
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Administrasi
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Akuntansi
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Alfamart
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Arsiparis
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Artis
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Astra
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Asuransi
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Auditor
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20BJB
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20BNI%20Syariah
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20BRI
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20Danamon
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20Mandiri
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20Indonesia
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20BCA
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20BTN
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank%20CIMB%20NIAGA
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20BUMN
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Terbaru
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20SMA
    http://www.lokerjobindo.com
    http://www.wisatasia.id/search/label/Wisata-Indonesia

    http://www.wisatasia.id

Skip to main content