Skip to content

Latest commit

 

History

History
75 lines (53 loc) · 2.5 KB

xp-enumgroups-transact-sql.md

File metadata and controls

75 lines (53 loc) · 2.5 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
xp_enumgroups (Transact-SQL)
Provides a list of local Microsoft Windows groups or a list of global groups that are defined in a specified Windows domain.
markingmyname
maghan
randolphwest
03/07/2025
sql
system-objects
reference
xp_enumgroups_TSQL
xp_enumgroups
xp_enumgroups
TSQL

xp_enumgroups (Transact-SQL)

[!INCLUDE SQL Server]

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

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

xp_enumgroups [ 'domain_name' ]

Arguments

[!INCLUDE extended-stored-procedures]

'domain_name'

The name of the Windows 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 set

Column name Data type Description
group sysname Name of the Windows group
comment sysname Description of the Windows group provided by Windows

Remarks

If domain_name is the name of the Windows-based computer that an instance of [!INCLUDE ssNoVersion] is running on, or no domain name is specified, xp_enumgroups enumerates the local groups from the computer that is running [!INCLUDE ssNoVersion].

Permissions

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

Examples

The following example lists the groups in the sales domain.

EXEC xp_enumgroups 'sales';

Related content