In this article, we take the sledgehammer approach in searching for MDFs and then comparing them against files which are available on the listed drive. The idea behind this is to generate a report of detached database files across multiple servers. That’s one way to keep our databases compliant in terms of meeting SLAs, and ensuring optimal performance. Running such reports periodically helps us to achieve compliance in terms of file auditing.
Further reading multi-server-script-find-orphaned-data-files-using-powershell
Please share your thoughts in the comments section. I would love to hear and learn from you as well.
Thanks for reading my space!