Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Database.EnumWindowsGroups Method

 

Applies To: SQL Server 2016 Preview

Enumerates a list of Windows groups.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

NameDescription
System_CAPS_pubmethodEnumWindowsGroups()

Enumerates a list of Windows groups.

System_CAPS_pubmethodEnumWindowsGroups(String)

Enumerates a list of Windows groups for a specified group.

Return to top

Database.EnumWindowsGroups Method ()

Enumerates a list of Windows groups.

public DataTable EnumWindowsGroups()

Return Value

Type: System.Data.DataTable

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.

Legacy Code Example

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

VB

Code snippet is not found. Confirm that the code snippet name 'SMO How to' is correct.

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]
   }
}
Return to top

Database.EnumWindowsGroups Method (String)

Enumerates a list of Windows groups for a specified group.

public DataTable EnumWindowsGroups(
	string groupName
)

Parameters

groupName
Type: System.String

A String value that specifies a Windows group name.

Return Value

Type: System.Data.DataTable

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.

Legacy Code Example

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

VB

Code snippet is not found. Confirm that the code snippet name 'SMO How to' is correct.

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]
   }
}
Return to top
Show:
© 2015 Microsoft