select rtrim(CONVERT(char(256), SERVERPROPERTY('servername'))) as SQLInstance, a.name as LoginName, 
	isnull(type_desc, '') as type_desc, isntname, isntgroup, isntuser, isnull(is_disabled, 0) as is_disabled
--	, createdate, updatedate, dbname, is_policy_checked, is_expiration_checked
   , a.sysadmin, a.securityadmin
--	, a.serveradmin, a.setupadmin, a.processadmin, a.diskadmin, a.dbcreator, a.bulkadmin
from master.sys.sql_logins x right outer join master.sys.syslogins a on x.name = a.name
-- select * from master.sys.syslogins
--where a.name not in ('sa','sql_sa','NT AUTHORITY\SYSTEM','NT SERVICE\MSSQLSERVER','PL\IBMSQLAdminsPL',
--	'PL\SSSAITMSQLAGT','NT SERVICE\SQLSERVERAGENT','PL\YGAPSDD_SQL','ELIFE\sssITMSQLsrv','ELIFE\sssLogShippingSQL',
--	'ELIFE\ElSrv_Clu','PLDEV\Local IBM SQL Admins','PLDEV\Local SDD SQL','sssLogShippingSQL')
--	and a.name not like '#%'
--	and a.name not like '%\Administrator'
--	and a.name not like '%\UserSQL33'	
--	and a.name not like 'NT SERVICE\MSSQL%'
--	and a.name not like 'NT SERVICE\SQLAgent%'
--	and a.name not like 'PL\SSSAISQL%'
----	and a.name not like 'PL\sssaa%'
--	and a.name not like 'PL\%$'
--	and a.name not like 'ELIFE\SQL%'
--	and a.name not like 'PLDEV\sss%'
----	and 1 in (a.sysadmin, a.securityadmin, a.serveradmin, a.setupadmin, a.processadmin, a.diskadmin, a.dbcreator) 

select rtrim(CONVERT(char(256), SERVERPROPERTY('ComputerNamePhysicalNetBIOS'))) as ServerP, a.name as LoginName, 
	isnull(type_desc, '') as type_desc, isntname, isntgroup, isntuser, isnull(is_disabled, 0) as is_disabled
--	, createdate, updatedate, dbname, is_policy_checked, is_expiration_checked
   , a.sysadmin, a.securityadmin
--	, a.serveradmin, a.setupadmin, a.processadmin, a.diskadmin, a.dbcreator, a.bulkadmin
from master.sys.sql_logins x right outer join master.sys.syslogins a on x.name = a.name
-- select * from master.sys.syslogins
--where a.name not in ('sa','sql_sa','NT AUTHORITY\SYSTEM','NT SERVICE\MSSQLSERVER','PL\IBMSQLAdminsPL',
--	'PL\SSSAITMSQLAGT','NT SERVICE\SQLSERVERAGENT','PL\YGAPSDD_SQL','ELIFE\sssITMSQLsrv','ELIFE\sssLogShippingSQL',
--	'ELIFE\ElSrv_Clu','PLDEV\Local IBM SQL Admins','PLDEV\Local SDD SQL','sssLogShippingSQL')
--	and a.name not like '#%'
--	and a.name not like '%\Administrator'
--	and a.name not like '%\UserSQL33'	
--	and a.name not like 'NT SERVICE\MSSQL%'
--	and a.name not like 'NT SERVICE\SQLAgent%'
--	and a.name not like 'PL\SSSAISQL%'
----	and a.name not like 'PL\sssaa%'
--	and a.name not like 'PL\%$'
--	and a.name not like 'ELIFE\SQL%'
--	and a.name not like 'PLDEV\sss%'
----	and 1 in (a.sysadmin, a.securityadmin, a.serveradmin, a.setupadmin, a.processadmin, a.diskadmin, a.dbcreator) 
