Posts

Showing posts from 2020

PowerShell CSOM get SharePoint List members permissions

Clear - Host Add - Type - Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add - Type - Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" $siteUrl = "http://sp" $user = "contoso\administrator" $password = "Access1" | ConvertTo - SecureString - AsPlainText - Force $ctx = new - object Microsoft . SharePoint . Client . ClientContext ( $siteUrl ) $credentials = $ctx . Credentials = New - Object System . Net . NetworkCredential ( $user , $password ) $ctx . Credentials = $credentials $web = $ctx . Web $list = $web . Lists . GetByTitle ( "Student" ) $ctx . Load ( $list ) $ctx . ExecuteQuery () $listroleassignments = $list . RoleAssignments $ctx . Load ( $listroleassignments ) $ctx . ExecuteQuery () foreach ( $listroleassgnment in $listrole