Database.EnumWindowsGroups Database.EnumWindowsGroups Database.EnumWindowsGroups Method

Definition

Enumerates a list of Windows groups.

Overloads

EnumWindowsGroups() EnumWindowsGroups() EnumWindowsGroups()

Enumerates a list of Windows groups.

EnumWindowsGroups(String) EnumWindowsGroups(String) EnumWindowsGroups(String)

Enumerates a list of Windows groups for a specified group.

EnumWindowsGroups() EnumWindowsGroups() EnumWindowsGroups()

Enumerates a list of Windows groups.

public:
 System::Data::DataTable ^ EnumWindowsGroups();
public System.Data.DataTable EnumWindowsGroups ();
Public Function EnumWindowsGroups () As DataTable
Returns

A DataTable object value that contains a list of Windows groups. The table describes the different columns of the returned DataTable.

Column
Data type
Description
Urn
String The URN string that represents the Windows group.
Name
String The name of the Windows group.
ID
Int32 The ID value that uniquely identifies the Windows group.
Login
String The login that represents the Windows group in SQL Server.
IsSystemObject
Boolean The Boolean value that specifies whether the Windows group is a system object.
LoginType
DateTime The type of login. See LoginType.
HasDBAccess
Boolean The Boolean value that specifies whether the Windows group as access to the referenced database.
Sid
Int32 The login security identifier for the Windows group.
UserType
String The type of user. See UserType.
Certificate
String The certificate that the Windows group uses to log on to SQL Server.
AsymmetricKey
String The asymmetric key that the Windows group uses to log on to SQL Server.
CreateDate
DateTime The date and time when the Windows group was created.
DateLastModified
DateTime The date and time when the Windows group was last modified.
DefaultSchema
String The default schema associated with the Windows group.

Examples

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

VB

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

EnumWindowsGroups(String) EnumWindowsGroups(String) EnumWindowsGroups(String)

Enumerates a list of Windows groups for a specified group.

public:
 System::Data::DataTable ^ EnumWindowsGroups(System::String ^ groupName);
public System.Data.DataTable EnumWindowsGroups (string groupName);
Public Function EnumWindowsGroups (groupName As String) As DataTable
Parameters
groupName
String String String

A String value that specifies a Windows group name.

Returns

A DataTable object value that contains Windows group information for the specified group. The table describes the different columns of the returned DataTable.

Column
Data type
Description
Urn
String The URN string that represents the Windows group.
Name
String The name of the Windows group.
ID
Int32 The ID value that uniquely identifies the Windows group.
Login
String The login that represents the Windows group in SQL Server.
IsSystemObject
Boolean The Boolean value that specifies whether the Windows group is a system object.
LoginType
DateTime The type of login. See LoginType.
HasDBAccess
Boolean The Boolean value that specifies whether the Windows group as access to the referenced database.
Sid
Int32 The login security identifier for the Windows group.
UserType
String The type of user. See UserType.
Certificate
String The certificate that the Windows group uses to log on to SQL Server.
AsymmetricKey
String The asymmetric key that the Windows group uses to log on to SQL Server.
CreateDate
DateTime The date and time when the Windows group was created.
DateLastModified
DateTime The date and time when the Windows group was last modified.
DefaultSchema
String The default schema associated with the Windows group.

Examples

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

VB

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

Applies to