none
Setting Permissions on a View via Powershell Script RRS feed

  • Question

  • After listing out the permissions via $vwObject.EnumObjectPermissions()

           PermissionType : ALTER
           Grantee : Endpoint-Admins
           GranteeType : ServerRole
           Grantor : BASE\ctrlb
           GrantorType : Login
           PermissionState : Grant
           ColumnName :
           ObjectClass : ObjectOrColumn
           ObjectName : TestView2
           ObjectSchema :
           ObjectID : 65536

    And you need to change it to 

           PermissionType : SELECT
           Grantee : Endpoint-Users
           GranteeType : User
           Grantor : dbo
           GrantorType : User
           PermissionState : Grant
           ColumnName :
           ObjectClass : ObjectOrColumn
           ObjectName : TestView2
           ObjectSchema : dbo
           ObjectID : 65536

    What is an example for how to use permissionSet to do so, please?


    • Moved by Bill_Stewart Monday, April 30, 2018 9:39 PM This is not "teach me how to use SQL from PowerShell" forum
    Wednesday, February 28, 2018 12:35 AM

All replies