xp_enumgroups (T-SQL)

Provides a list of local Microsoft® Windows NT® groups or a list of global groups defined in a specified Windows NT domain.

Syntax

xp_enumgroups ['domain_name']

Arguments
'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.
Return Code Values

0 (success) or 1 (failure)

Result Sets
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

Remarks

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.

Permissions

Execute permissions for xp_enumgroups default to members of the sysadmin fixed server role but can be granted to other users.

Examples

This example lists the groups in the sales domain.

EXEC xp_enumgroups 'sales'

  

See Also
sp_grantlogin xp_logininfo
sp_revokelogin System Stored Procedures (General Extended Procedures)
xp_loginconfig  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.