Home Forums SQL Server 2005 Administering Need script that totals free disk space AND free space in files RE: Need script that totals free disk space AND free space in files

  • Tried a few things including the suggested scripts from Steve. Since our production environment uses mount points and because sp_databases returns null for larger databases, etc etc, I'll probably just use our Quest spotlight tool. It will provide both disk free and free inside files, just not in one view. We only have one data file, which needs work, that has a substantial amount of free space in the file -- substantial meaning over 100GB, so free space on disk is probably good enough as something to watch, set up alerts, and request more disk space as needed.

    Tried this powershell on our prod environment but it isn't reporting "inside" the mount points, just free space on the folder hosting the mount points.

    Get-WmiObject -ComputerName Remoteserver -Class Win32_LogicalDisk | Select -Property DeviceID, @{Name=’FreeSpaceMB’;Expression={$_.FreeSpace/1MB} } | Format-Table -AutoSize