SQL server remove public view permissions

To remove all accounts with the public role only and prevent them from seeing other databases they have no need to see, run this query.

USE master;
GO

REVOKE VIEW ANY DATABASE
 TO PUBLIC;