How to Update List Settings using PowerShell in SharePoint Online

Prerequisites:

SharePoint Online Management Shell: https://www.microsoft.com/en-us/download/details.aspx?id=35588

PnP – PowerShell Cmdlets: https://github.com/officedev/pnp-powershell/releases

PowerShell Script:

Open SharePoint Online Management Shell and execute the following script.

  1. ## Connects to a SharePoint Site  
  2. Connect-SPOnline -Url https://c986.sharepoint.com -Credentials (Get-Credential)  
  3.   
  4. ## Syntax: Set-SPOList -Identity <ListPipeBind> [-EnableContentTypes <Boolean>] [-BreakRoleInheritance [<SwitchParameter>]] [-CopyRoleAssignments [<SwitchParameter>]] [-ClearSubscopes [<SwitchParameter>]] [-Title <String>] [-Web <WebPipeBind>]  
  5. ## Update list settings  
  6. Set-SPOList -Identity "Custom List" -EnableContentTypes $true -BreakRoleInheritance   
  7.   
  8. ##Disconnects the context  
  9. Disconnect-SPOnline