EnumAccountInfo Method (SQL-DMO)

The EnumAccountInfo method returns a QueryResults object enumerating Microsoft® Windows NT® accounts granted access privilege to a Microsoft SQL Server™ installation.

Applies To

SQLServer Object

Syntax

object.EnumAccountInfo( [ Account ] , [ ListAll ] ) as QueryResults

Part Description
object Expression that evaluates to an object in the Applies To list
Account String identifying an existing  Windows NT user or group by name
ListAll True or False

Returns

A QueryResults object containing one result set defined by these columns.

Column Data type Description
account name nvarchar(129) Windows NT account name
type varchar(18) String identifying account type, such as group
privilege varchar(18) String specifying privilege level, such as admin or username
mapped login name nvarchar(129) SQL Server login name used when mapping the account
permission path nvarchar(129) String specifying Windows NT group granting access

Remarks

When using the Account argument to restrict results, fully qualify the Windows NT account name, specifying both domain and user or group name. For example:

oQR = oSQLServer.EnumAccountInfo("SEATTLE\anned")

When specifying a Windows NT group by using the Account argument, the QueryResults object returned contains one row for each Windows NT account with membership in the group.

Use the ListAll argument when enumerating account information for Windows NT users. When ListAll is True, the EnumAccountInfo method returns a result set containing all SQL Server security-enabled Windows NT groups in which the specified user has membership.

Prototype (C/C++)

HRESULT EnumAccountInfo(
LPSQLDMOQUERYRESULTS* ppResults,
SQLDMO_LPCSTR Account = NULL,
BOOL ListAll = FALSE);

  


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