Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Server.EnumObjectPermissions Method

Enumerates a list of object permissions for the instance of SQL Server.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
'Declaration
Public Function EnumObjectPermissions As ObjectPermissionInfo()
'Usage
Dim instance As Server 
Dim returnValue As ObjectPermissionInfo()

returnValue = instance.EnumObjectPermissions()

Return Value

Type: Microsoft.SqlServer.Management.Smo.ObjectPermissionInfo()
An array of ObjectPermissionInfo objects that contains object permission information for the instance of SQL Server.

C#

Server srv = new Server("(local)");

ObjectPermissionInfo[] oPI = srv.EnumObjectPermissions();
foreach (ObjectPermission op in oPI[])
{
   Console.WriteLine(op.ToString());
}

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")

$oPI = $srv.EnumObjectPermissions()
foreach ($op in $oPI)
{
   Write-Host $op
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.