
1.You could use following PNP PowerShell to delete unique permissions for a document library.
#Set Variables
$SiteURL = "https://tenant.sharepoint.com/sites/marketing/2018"
$FolderURL = "/Shared Documents" #Document Library Site Relative URL
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive #-Credentials (Get-Credential)
#Function to reset permissions of all Sub-Folders
Function Reset-SubFolderPermissions($FolderURL)
{
#Get all sub-folders of the Folder - Exclude system folders
$SubFolders = Get-PnPFolderItem -FolderSiteRelativeUrl $FolderURL -ItemType Folder | Where {$_.Name -ne "Forms" -and $_.Name -ne "Document"}
#Loop through each sub-folder
ForEach($SubFolder in $SubFolders)
{
$SubFolderURL = $FolderUrl+"/"+$SubFolder.Name
Write-host -ForegroundColor Green "Processing Folder '$($SubFolder.Name)' at $SubFolderURL"
#Get the Folder Object - with HasUniqueAssignments and ParentList properties
$Folder = Get-PnPFolder -Url $SubFolderURL -Includes ListItemAllFields.HasUniqueRoleAssignments, ListItemAllFields.ParentList, ListItemAllFields.ID
#Get the List Item of the Folder
$FolderItem = $Folder.ListItemAllFields
#Check if the Folder has unique permissions
If($FolderItem.HasUniqueRoleAssignments)
{
#Reset permission inheritance
Set-PnPListItemPermission -List $FolderItem.ParentList -Identity $FolderItem.ID -InheritPermissions
Write-host "`tUnique Permissions are removed from the Folder!"
}
#Call the function recursively
Reset-SubFolderPermissions $SubFolderURL
}
}
#Call the function
Reset-SubFolderPermissions $FolderURL
2.If the child folder does not have permission inheritance from its parent folder, there is no option to apply the permission change for the parent folder to the child folder. The only way is you need to manually change permission for the child folder.
3.It is decided by Windows that deleted files will be move to Windows recycle bin. It cannot be disabled by SharePoint.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.