Export (0) Print
Expand All

xp_enumgroups (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Provides a list of local Microsoft Windows groups or a list of global groups that are defined in a specified Windows domain.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

xp_enumgroups [ 'domain_name' ]

' domain_name '

Is the name of the Windows 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 group

comment

sysname

Description of the Windows group provided by Windows

If domain_name is the name of the Windows-based computer that an instance of SQL Server is running on, or no domain name is specified, xp_enumgroups enumerates the local groups from the computer that is running SQL Server.

xp_enumgroups cannot be used when an instance of SQL Server is running on Windows 98.

Requires membership in the db_owner fixed database role in the master database, or membership in the sysadmin fixed server role.

The following example lists the groups in the sales domain.

EXEC xp_enumgroups 'sales';
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft