• Nice script!

    I wrote something similar, but with a different approach.

    My solution uses a central server for various checks and reports. One of these is on database usage: each night a script collects the defined sizes and the actual usage of all data and log devices of every database on a set of (linked) servers (using 'DBCC SHOWFILESTATS' and 'DBCC SQLPERF(LOGSPACE)').

    This records database space usage on all my SQL servers and allows me to report on database size history (for trending purposes).

    In addition, it uses the info recorded on a daily basis to email any changes in data or log device size (auto-growth or manual expansion).

    In case you're interested I can share the code.