SOLVED

Modify Permissions on Existing Files and Folder

%3CLINGO-SUB%20id%3D%22lingo-sub-857654%22%20slang%3D%22en-US%22%3EModify%20Permissions%20on%20Existing%20Files%20and%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857654%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20used%20the%20SharePoint%20migration%20tool%20to%20migrate%20250Gb%20of%20data.%26nbsp%3B%20These%20files%20are%20within%2025%20folder%20then%20subfolders.%20The%20permissions%20on%20each%20folder%20was%20updated%20using%20the%20migration%20tool%20which%20is%20great.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20I%20now%20need%20to%20modify%20the%20permissions%20from%20the%20View%20Only%20to%20Edit.%26nbsp%3B%20I've%20changed%20the%20permissions%20on%20the%20Site%20and%20the%20Library%2C%20however%2C%20the%20permissions%20are%20not%20being%20overridden%20or%20updated%20to%20the%20subfolders%20and%20files%20so%20users%20still%20cannot%20edit.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20select%20all%20the%20folders%2C%20the%20Manage%20Access%20is%20not%20enabled%20so%20I%20can't%20do%20it%20there.%26nbsp%3B%20I've%20found%20the%20only%20way%20to%20do%20this%20is%20to%20select%201%20folder%20%26gt%3B%20Manage%20Access%20%26gt%3B%20Change%20to%20Edit%20but%20this%20will%20take%20forever.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20no%20way%20to%20reapply%20the%20security%20to%20existing%20folders%20and%20files%20when%20I%20change%20the%20Library%20permissions%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-857654%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-857804%22%20slang%3D%22en-US%22%3ERe%3A%20Modify%20Permissions%20on%20Existing%20Files%20and%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857804%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F143000%22%20target%3D%22_blank%22%3E%40Mercedes%20Green%3C%2FA%3E%26nbsp%3B%20only%20way%20I%20found%20to%20do%20this%20was%20to%20run%20a%20powershell%20script.%20However%20this%20took%20forever%20and%20I%20was%20not%20sure%20if%20it%20has%20actually%20worked.%20Here%20is%20the%20script%20using%20pnp%3A%20-%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24Log%20%3D%200%0A%24items%20%3D%20Get-PnPListItem%20-List%20Companies%20-PageSize%201000%20%20%7C%20where%20%7B%24_.HasUniqueRoleAssignments%7D%0Aforeach(%24item%20in%20%24items)%0A%7B%0Atry%0A%7B%0A%24Log%20%3D%20%20%24Log%20%2B%201%0A%24_.ResetRoleInheritance()%0AWrite-Host%20%24log%0A%7D%0Acatch%0A%7B%0AWrite-Host%20%E2%80%9Cerror%E2%80%9D%0A%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20broke%20it%20into%20chunks%20of%201000%20items%20as%20returning%20the%20list%20of%20files%20was%20taking%20too%20long.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20not%20run%20that%20in%20a%20while%20so%20no%20guarantees%20it%20will%20work.%26nbsp%3B%20The%20other%20thing%20you%20may%20try%20is%20reapply%20the%20permissions%20to%20the%20library%20but%20tick%20the%20box%20%22%3CSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3EShare%20everything%20in%20this%20folder%2C%20even%20items%20with%20unique%20permissions.%3C%2FSPAN%3E%22%26nbsp%3B%20Sometimes%20that%20works%20sometimes%20it%20says%20you%20are%20over%20the%20list%20threshold.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

We used the SharePoint migration tool to migrate 250Gb of data.  These files are within 25 folder then subfolders. The permissions on each folder was updated using the migration tool which is great.

 

However, I now need to modify the permissions from the View Only to Edit.  I've changed the permissions on the Site and the Library, however, the permissions are not being overridden or updated to the subfolders and files so users still cannot edit.

 

If I select all the folders, the Manage Access is not enabled so I can't do it there.  I've found the only way to do this is to select 1 folder > Manage Access > Change to Edit but this will take forever.

 

Is there no way to reapply the security to existing folders and files when I change the Library permissions?

1 Reply
Highlighted
Best Response confirmed by Juan Carlos González Martín (MVP)
Solution

@Mercedes Green  only way I found to do this was to run a powershell script. However this took forever and I was not sure if it has actually worked. Here is the script using pnp: - 

 

 

$Log = 0
$items = Get-PnPListItem -List Companies -PageSize 1000  | where {$_.HasUniqueRoleAssignments}
foreach($item in $items)
{
try
{
$Log =  $Log + 1
$_.ResetRoleInheritance()
Write-Host $log
}
catch
{
Write-Host “error”
}
}

 

 

I broke it into chunks of 1000 items as returning the list of files was taking too long. 

I have not run that in a while so no guarantees it will work.  The other thing you may try is reapply the permissions to the library but tick the box " Share everything in this folder, even items with unique permissions."  Sometimes that works sometimes it says you are over the list threshold.