I am trying to break permission inheritance for certain folders in my document library in office 365. However when $folder.BreakRoleInheritance($false) is executed I get an error:

Method invocation failed because [Microsoft.sharepoint.client.folder] does not contain a method named breakroleinheritance

my code:

function GetChildFolders($RootFolder) 
    if($count -ne 1){



    if($folderName -eq $FolderRelativePath){                                
        Write-host "Inheritance Broken"
        $group = $Context.web.SiteGroups[$groupAD];   
        write-host "group added"
        $collRdb = new-object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection($context)

        Write-host "Permission added"
        $collRoleAssign = $RootFolder.Item.RoleAssignments

        $rollAssign = $collRoleAssign.Add($group, $collRdb)


    foreach($folder in $RootFolder.Folders)
        GetChildFolders $folder                       
GetChildFolders $List.RootFolder

1 Answer 1


Microsoft.sharepoint.client.folder does not have property for "BreakRoleInheritance"

You can use as below to break permission inheritance


Hope it will help to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.