| title | xp_enumgroups (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/14/2017 | ||
| ms.prod | sql-non-specified | ||
| ms.reviewer | |||
| ms.suite | |||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 0bd3ed36-e260-469c-a5ff-b033fb9ea59d | ||
| caps.latest.revision | 23 | ||
| author | BYHAM | ||
| ms.author | rickbyh | ||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]
Provides a list of local Microsoft Windows groups or a list of global groups that are defined in a specified Windows domain.
| Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version). |
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 [!INCLUDEssNoVersion] is running on, or no domain name is specified, xp_enumgroups enumerates the local groups from the computer that is running [!INCLUDEssNoVersion].
xp_enumgroups cannot be used when an instance of [!INCLUDEssNoVersion] 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';
sp_grantlogin (Transact-SQL)
sp_revokelogin (Transact-SQL)
System Stored Procedures (Transact-SQL)
General Extended Stored Procedures (Transact-SQL)
xp_loginconfig (Transact-SQL)
xp_logininfo (Transact-SQL)