SharePoint Online SPOMod: Remove-SPOListItemInheritance
This article describes a function of a custom SharePoint Online module available for download and installation at GitHub.
Remove-SPOListItemInheritance
Breaks permission inheritance for a list item and grants unique permissions to that list item. Optionally, it removes the existing permissions.
Parameters
ListTitle | Mandatory | Name of the list |
ItemID | Mandatory | ID of the item |
KeepPermissions | Optional | Boolean. Defines whether the current permissions should be kept. If set to $false, clears all the assigned permissions and leaves control only for the administrator executing the cmdlet. By default set to $true. |
Examples
----- EXAMPLE 1 ------
Break inheritance for a single item
Remove-SPOListItemInheritance -ListTitle MyList6 -ItemID 5 -KeepPermissions $false
----- EXAMPLE 2 ------
Break inheritance for a single item using positions to define parameters
Remove-SPOListItemInheritance MyList6 2 $true