powershell - SharePoint CSOM Copy - RoleAssignment -


hope can me out. i'm working on powershell script performing serveral modifications on sharepoint environment.

i want copy roleassignments on web other in same site collection. basicly works when run commands manual in console doesent work while running script.

what this.

    $roleassignmentmember =  $roomwebroleassignment.member     $rolebindings =  $roomwebroleassignment.roledefinitionbindings     $ctx.load($roleassignmentmember)     $ctx.load($rolebindings)     $ctx.executequery()       $web.roleassignments.add($roleassignmentmember, $rolebindings)     $ctx.executequery() 

running $web.roleassignments.add($roleassignmentmember, $rolebindings) in console works.. not in script .. got error collection not ready .. acutally is^^..

any ideas ? hope can greetz

sorry, silly me.

for people interested:

# load $ctx.load($web.roleassignments.add($roleassignmentmember, $rolebindings)); $ctx.executequery(); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -