문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Server.EnumObjectPermissions 메서드 (String, ObjectPermissionSet)

Enumerates a list of object permissions for a specified grantee and a specified permission on the instance of SQL Server.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

public ObjectPermissionInfo[] EnumObjectPermissions(
	string granteeName,
	ObjectPermissionSet permissions
)

매개 변수

granteeName
유형: System.String
A String value that specifies the grantee.
permissions
유형: Microsoft.SqlServer.Management.Smo.ObjectPermissionSet
An ObjectPermissionSet object value that specifies the permission.

반환 값

유형: Microsoft.SqlServer.Management.Smo.ObjectPermissionInfo[]
An array of ObjectPermissionInfo objects that contains object permission information for the specified grantee and permission on the instance of SQL Server.

C#

Server srv = new Server("(local)");
ObjectPermissionSet objPermission = new ObjectPermissionSet();
objPermission.Add(ObjectPermission.Connect);
ObjectPermissionInfo[] oPI = srv.EnumObjectPermissions(grantee, objPermission);
foreach (ObjectPermissionInfo op in oPI)
{
   Console.WriteLine(op.ToString());
}

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$objPermission = new-object Microsoft.SqlServer.Management.Smo.ObjectPermissionSet
$objPermission.Add([Microsoft.SqlServer.Management.Smo.ObjectPermission]::Connect)
$oPI = $srv.EnumObjectPermissions(grantee, $objPermission)
foreach ($op in $oPI)
{
   Write-Host $op

}

커뮤니티 추가 항목

추가
표시: