As a SQL Server DBA, managing user access and permissions is crucial. Often, users belong to Active Directory (AD) groups that grant them access to the SQL Server instance. Knowing which users belong to which groups helps you effectively manage security and identify potential access issues.
1. Finding Members of an Active Directory Group:
exec master.dbo.xp_logininfo 'DBAScrolls\sqldba', 'members'
2. Finding out Active directory group that user belong to:
exec master.dbo.xp_logininfo 'DBAScrolls\sqldba'