次の方法で共有


EnumWindowsGroups メソッド

Windows グループの一覧を列挙します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
Public Function EnumWindowsGroups As DataTable
'使用
Dim instance As Database
Dim returnValue As DataTable

returnValue = instance.EnumWindowsGroups()
public DataTable EnumWindowsGroups()
public:
DataTable^ EnumWindowsGroups()
member EnumWindowsGroups : unit -> DataTable 
public function EnumWindowsGroups() : DataTable

戻り値

型: System.Data. . :: . .DataTable
Windows グループの一覧を含む DataTable オブジェクトの値。次の表に、返される DataTable の列を示します。

データ型

説明

Urn

String

Windows グループを表す URN 文字列です。

Name

String

Windows グループの名前です。

ID

Int32

Windows グループを一意に識別する ID 値です。

Login

String

SQL Server の Windows グループを表すログインです。

IsSystemObject

Boolean

Windows グループがシステム オブジェクトであるかどうかを示すブール値です。

LoginType

DateTime

ログインの種類です。「LoginType」を参照してください。

HasDBAccess

Boolean

Windows グループが参照先データベースにアクセスできるかどうかを示すブール値です。

Sid

Int32

Windows グループのログイン セキュリティ識別子です。

UserType

String

ユーザーの種類です。「UserType」を参照してください。

Certificate

String

Windows グループが SQL Server にログオンするために使用する証明書です。

AsymmetricKey

String

Windows グループが SQL Server にログオンするために使用する非対称キーです。

CreateDate

DateTime

Windows グループを作成した日時です。

DateLastModified

DateTime

Windows グループを最後に変更した日時です。

DefaultSchema

String

Windows グループに関連付けられた既定のスキーマです。

使用例

次の例では、Server オブジェクト列挙メソッドを実行しますが、DataTable オブジェクトからの情報の抽出方法は、Database 列挙メソッドの場合と同じです。

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