TIP - How do I prevent users from seeing DBs in Enterprise Manager/SSMS that they don't have rights to?

I came across this excellent blog by Euan Garden, who is a Group Program Manager at Microsoft.

https://blogs.msdn.com/euanga/archive/2006/05/04/585513.aspx

In this blog, he tries to answer the most commonly asked question - how to hide databases from users who don't have acess to them?

He has provided a pretty simple script that you can use to achieve this functionality. Happy reading!