문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
|
번역
영문
|
Visual Studio 2017을 사용하는 것이 좋습니다.
Server.EnumWindowsUserInfo 메서드 (String)
SQL Server 2012
Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to the instance of SQL Server.
네임스페이스: Microsoft.SqlServer.Management.Smo
어셈블리: Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)
매개 변수
- account
- 유형: System.String
A String value that specifies a Windows user account on which to limit the results.
반환 값
유형: System.Data.DataTableA DataTable object value that contains a list of Windows users that have explicitly granted access to the instance of SQL Server. The table describes the different columns of the returned DataTable.
C#
Server srv = new Server("(local)"); DataTable d = srv.EnumWindowsUserInfo("NT AUTHORITY\\System"); 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.EnumWindowsUserInfo("NT AUTHORITY\System") foreach ($r in $d.Rows) { Write-Host "============================================" Foreach ($c in $d.Columns) { Write-Host $c.ColumnName "=" $r[$c] } }
표시: