EnumWindowsDomainGroups 方法 (String)
列舉所指定網域上定義之 Microsoft Windows 群組帳戶的清單。
命名空間: Microsoft.SqlServer.Management.Smo
組件: Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)
語法
'宣告
Public Function EnumWindowsDomainGroups ( _
domain As String _
) As DataTable
'用途
Dim instance As Server
Dim domain As String
Dim returnValue As DataTable
returnValue = instance.EnumWindowsDomainGroups(domain)
public DataTable EnumWindowsDomainGroups(
string domain
)
public:
DataTable^ EnumWindowsDomainGroups(
String^ domain
)
member EnumWindowsDomainGroups :
domain:string -> DataTable
public function EnumWindowsDomainGroups(
domain : String
) : DataTable
參數
- domain
型別:System. . :: . .String
String 值,指定要限制其結果的網域。
傳回值
型別:System.Data. . :: . .DataTable
DataTable 系統物件值,包含指定網域之 Windows 群組帳戶的清單。下表將描述傳回之 DataTable 的不同資料行。
範例
C#
Server srv = new Server("(local)");
DataTable d = srv.EnumWindowsDomainGroups("ComputerName");
foreach (DataRow r in d.Rows)
{
Console.WriteLine("============================================");
foreach(DataColumn c in d.Columns)
{
Console.WriteLine(c.ColumnName + " = " + r[c].ToString());
}
}
PowerShell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$d = $srv.EnumWindowsDomainGroups("ComputerName")
foreach ($r in $d.Rows)
{
Write-Host "============================================"
Foreach ($c in $d.Columns)
{
Write-Host $c.ColumnName "=" $r[$c]
}
}