Situatie
Solutie
create procedure [dbo].[BD_Check_Policy_Logins]
as
select log.name AS [Name] FROM sys.server_principals AS log
LEFT OUTER JOIN master.dbo.syslanguages AS l ON l.name = log.default_language_name
LEFT OUTER JOIN sys.server_permissions AS sp ON sp.grantee_principal_id = log.principal_id and sp.type = N’COSQ’
LEFT OUTER JOIN sys.sql_logins AS sqllog ON sqllog.principal_id = log.principal_id
LEFT OUTER JOIN sys.credentials AS c ON c.credential_id = log.credential_id
LEFT OUTER JOIN master.sys.certificates AS cert ON cert.sid = log.sid
LEFT OUTER JOIN master.sys.asymmetric_keys AS ak ON ak.sid = log.sid
WHERE (log.type in (‘U’, ‘G’, ‘S’, ‘C’, ‘K’)
AND log.principal_id not between 101 and 255
AND log.name <> N’##MS_AgentSigningCertificate##’)
and CAST(sqllog.is_policy_checked AS bit)<>1
ORDER BY 1
Leave A Comment?