SELECT 'ALTER LOGIN ['+name+'] DISABLE' FROM sys.syslogins WHERE isntgroup = 0 AND isntuser = 0 AND name NOT IN ('dba','sa') AND name NOT LIKE '#%'
UNION
SELECT 'ALTER LOGIN ['+name+'] DISABLE' FROM sys.syslogins WHERE isntuser = 1 AND name LIKE 'CENTRALINFRA%'
UNION
SELECT 'DENY CONNECT ANY DATABASE TO ['+name+']' FROM sys.syslogins WHERE isntgroup = 1
UNION
SELECT 'DENY CONNECT SQL TO ['+name+']' FROM sys.syslogins WHERE isntgroup = 1