EnumWindowsGroups 方法 (String)

枚举用于指定组的 Windows 组的列表。

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public Function EnumWindowsGroups ( _
    groupName As String _
) As DataTable
用法
Dim instance As Database
Dim groupName As String
Dim returnValue As DataTable

returnValue = instance.EnumWindowsGroups(groupName)
public DataTable EnumWindowsGroups(
    string groupName
)
public:
DataTable^ EnumWindowsGroups(
    String^ groupName
)
member EnumWindowsGroups : 
        groupName:string -> DataTable 
public function EnumWindowsGroups(
    groupName : String
) : DataTable

参数

返回值

类型:System.Data. . :: . .DataTable
一个 DataTable 对象值,该值包含指定组的 Windows 组信息。该表描述所返回的 DataTable 的不同列。

数据类型

说明

Urn

String

表示 Windows 组的 URN 字符串。

Name

String

Windows 组的名称。

ID

Int32

唯一标识 Windows 组的 ID 值。

登录

String

表示 SQL Server 中 Windows 组的登录名。

IsSystemObject

Boolean

一个布尔值,该值指定 Windows 组是否为系统对象。

LoginType

DateTime

登录的类型。请参阅 LoginType

HasDBAccess

Boolean

一个布尔值,该值指定 Windows 组是否可以访问被引用数据库。

Sid

Int32

Windows 组的登录安全标识符。

UserType

String

用户的类型。请参阅 UserType

证书

String

Windows 组用于登录到 SQL Server 的证书。

AsymmetricKey

String

Windows 组用于登录到 SQL Server 的非对称密钥。

CreateDate

DateTime

创建 Windows 组的日期和时间。

DateLastModified

DateTime

上次修改 Windows 组的日期和时间。

DefaultSchema

String

与 Windows 组关联的默认架构。

示例

The example runs a Server object enumeration method, but extracting the information from the DataTable object is the same for Database enumeration methods.

VB

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Call the EnumCollations method and return collation information to DataTable variable.
Dim d As DataTable
'Select the returned data into an array of DataRow.
d = srv.EnumCollations
'Iterate through the rows and display collation details for the instance of SQL Server.
Dim r As DataRow
Dim c As DataColumn
For Each r In d.Rows
    Console.WriteLine("============================================")
    For Each c In r.Table.Columns
        Console.WriteLine(c.ColumnName + " = " + r(c).ToString)
    Next
Next

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")

$d = new-object System.Data.Datatable
$d = $srv.EnumCollations

Foreach ($r in $d.Rows)
{
   Write-Host "============================================"
   Foreach ($c in $d.Columns)
   {
      Write-Host $c.ColumnName "=" $r[$c]
   }
}