WI-DBA (5/11/2011)
@Nadrek - Its a preference really, I don't like having lots of maintenance jobs on my servers, and when I come up with something new to check, the single deployment makes the whole process much quicker to deploy.
The PowerShell for just a single database would be:
Get-SqlDatabase "WIN7W510\R2" "AdventureWorks" | Get-SqlDataFile | Format-Table Server, dbname, FileGroup, FileName, FreeSpace, timestamp
Just make sure to run this first if you haven't already:
Import-Module SQLServer
and obviously change out AdventureWorks to be the name of your database that you want to look at and "WIN7W510\R2" to be the name of the server & instance that database is on.
@SQLvariantI have a PowerShell script[/url] for you.