Provides a list of local Microsoft® Windows NT® groups or a list of global groups defined in a specified Windows NT domain.
xp_enumgroups ['domain_name']
'domain_name'
Is the name of the Windows NT domain for which to enumerate a list of global groups. domain_name is sysname, with a default of NULL.
0 (success) or 1 (failure)
Column name | Data type | Description |
---|---|---|
group | sysname | Name of the Windows NT group |
comment | sysname | Description of the Windows NT group provided by Windows NT |
If domain_name is the name of the Windows NT-based computer that Microsoft SQL Server™ is running on, or no domain name is specified, xp_enumgroups enumerates the local groups from the computer running SQL Server.
xp_enumgroups cannot be used when SQL Server is running on Windows® 95/98.
Execute permissions for xp_enumgroups default to members of the db_owner fixed database role in the master database and members of the sysadmin fixed server role, but can be granted to other users.
This example lists the groups in the sales domain.
EXEC xp_enumgroups 'sales'
System Stored Procedures (General Extended Procedures)