DBA - Get the list of AD users

Get the list  of AD users. 

SELECT 

   name AS [AD Account Name],
    type_desc AS [Account Type],
    create_date AS [Creation Date],     modify_date AS [Last Modified Date]
FROM 
    sys.server_principals
WHERE 
    type_desc IN ('WINDOWS_LOGIN', 'WINDOWS_GROUP')
ORDER BY 
    name;

 

Comments

Popular posts from this blog

DBA - Check health and status of Always On or Availability Group using DMVs

DBA - Script out the Linked server objects.

SQLDBA_ Failover -Registry Check Pointing a Windows Cluster to Bring SQL Server Online