This is fantastic. Thank You
I often search for things, but change the DB manually.
I often search for column names as well, so took the liberty in adding the below in your coding format to search for column names as well.
Set @Command = ''
Set @command = N'Insert into ##t001 Select ''[?]'' DataBaseName, o.name+'' - ''+c.name Object_name,''Column'' ObjectType, ''''
from [?].sys.objects o Join [?].sys.columns c On c.object_id = o.object_id where c.name like ''%'+@SearchText+'%'''
Execute sp_MSforeachdb @command, N'?'