Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Granting View Object Permissions via SQL PowerShell

Status
Not open for further replies.

DanFiggy

MIS
Mar 2, 2018
1
US
Can you please tell me how to set with Powershell the PermissionType : SELECT to ALTER? I'm attempting to use the:

Grant(ObjectPermissionSet, String, Boolean) - Grants access to the specified permission and the ability to grant access to other users for the specified View Class (object) I've setup - $vwobject.Grant(ALTER, Grantee, $TRUE) Would it be an ADD or GRANT and how does the syntax look?

Below is the result of a query of the permissions assigned to the View = TestView2 which I'd like to have multiple users assigned the same permission set - but for now, I'm just trying to Change SELECT to ALTER just to understand how to change or add to one property. Not understanding how the View.Grant method works syntactically - your help please?

$vwObject.EnumObjectPermissions()
PermissionType : SELECT
Grantee : SUTTER-CHS\InfaDev_service
GranteeType : User
Grantor : dbo
GrantorType : User
PermissionState : Grant
ColumnName :
ObjectClass : ObjectOrColumn
ObjectName : TestView2
ObjectSchema : dbo
ObjectID : 1510683327
 
hello, how is $vwobject defined / declared and set?

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top