Script para realizar o shrink em todos os bancos

 

EXEC master..sp_MSForeachDB '

USE [?]
IF ''?'' <> ''tempdb''
BEGIN                              DBCC
SHRINKDATABASE (''?'')
END'

GO