共用方式為


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
包含指定群組之 Windows 群組資訊的 DataTable 物件值。此表將描述傳回之 DataTable 的不同資料行。

資料行

資料類型

描述

Urn

String

代表 Windows 群組的 URN 字串。

名稱

String

Windows 群組的名稱。

ID

Int32

可唯一識別 Windows 群組的識別碼值。

Login

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]
   }
}