Leap Year

A leap year can be calculated using a formula (Please see Microsoft article), however there is no real need to calculate it this way. All that is needed in sql…

Last Backup Occurred

This script will show when the last backup occurred as well as the backup type for each database. This covers all the backup types available and pivots the output into…

Get-VolumeFreeSpace

Here is an example function to return free space remaining on a volume with associated details. Updated 27/04/2012 to fix mount points. Usage Examples: Get-VolumeFreeSpace|ft Get-VolumeFreeSpace|Select ComputerName,Name,MountPoint,FreeSpaceGiB|ft Get-VolumeFreeSpace|Where-Object {!$_.SystemVolume}|Select ComputerName,Name,MountPoint,FreeSpaceGiB|ft…

First day of the week

Given a particular date how do you determine the start date of that week? But more importantly what is the start of the week? The first column returned in the…

Get-DatabaseSizes

Simple example using SMO to get database storage information. You will need SMO installed for this script to work. Note Size relates to the file size on disk, where as…