Monday, January 13, 2014

Monitor SQL Server Disk Space Using PowerShell

Monitor SQL Server Disk Space Using PowerShell by  



http://www.mssqltips.com/sqlservertip/3109/monitor-sql-server-disk-space-using-powershell/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=20140113


Problem
I work in an environment where getting new software approved is often quite difficult. We have a disk space monitor in place, but it doesn't provide the type of monitoring my team was looking for. Monitoring disk space is critical for DBAs In addition, we use mount points, which is not supported by our existing disk space monitor.
Solution
My solution is PowerShell centric. Many of you may wonder why a DBA would use PowerShell. I tend to use the following guidelines to determine whether I will use PowerShell or TSQL to perform a task.
  • TSQL - If the primary function of the task is set based (Select, Insert, Update, Delete), I use TSQL
  • PowerShell - If the task I am trying to perform has a significant amount of flow control, or needs to access objects that are not SQL, I tend to use PowerShell

No comments:

Post a Comment