Udostępnij za pośrednictwem


Metoda Database.EnumWindowsGroups

Wylicza listę grup systemu Windows.

Przestrzeń nazw:  Microsoft.SqlServer.Management.Smo
Zestaw:  Microsoft.SqlServer.Smo (w Microsoft.SqlServer.Smo.dll)

Składnia

'Deklaracja
Public Function EnumWindowsGroups As DataTable
'Użycie
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

Wartość zwracana

Typ: System.Data.DataTable
A DataTable wartość obiekt zawierający listę grup systemu Windows.W tabela opisano różne kolumny zwracane DataTable.

Kolumna

Typ danych

Opis

Nazwa URN

String

Ciąg nazwy URN, który reprezentuje grupę systemu Windows.

Nazwa

String

Nazwa grupy systemu Windows.

Identyfikator

Int32

Wartość Identyfikatora, który unikatowo identyfikuje grupę systemu Windows.

Identyfikator logowania

String

Logowania, który reprezentuje grupę systemu Windows w SQL Server.

IsSystemObject

Boolean

Wartość logiczna określająca, czy grupa systemu Windows jest obiekt systemowy.

LoginType

DateTime

Typ logowania.Zobacz LoginType.

HasDBAccess

Boolean

Wartość logiczna określająca, czy grupy systemu Windows, jak dostęp do odnośna baza danych.

Identyfikator SID

Int32

Identyfikator zabezpieczeń logowania dla grupy systemu Windows.

UserType

String

Typ użytkownika.Zobacz UserType.

Certyfikat

String

certyfikat , Grupa systemu Windows używa do logowania się na SQL Server.

AsymmetricKey

String

klucz asymetrycznego, który grupa systemu Windows używa do logowania się na SQL Server.

CreateDate

DateTime

Data i czas utworzenia grupy systemu Windows.

DateLastModified

DateTime

Data i czas ostatniej modyfikacji grupy systemu Windows.

DefaultSchema

String

Domyślny schemat skojarzone z grupy systemu Windows.

Przykłady

Przykład uruchamia serwer wyliczania obiektu metoda, ale wyodrębnianie informacji z DataTable obiektu jest taka sama dla metoda wyliczania bazy danych.

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