Sitecore powershell - Reset security

Sitecore powershell is a really strong tool for managing tedious task in Sitecore.

It takes the power of Powershell and allows you to use it on Sitecore Items sprinkled with Sitecore specific functions.


Just the other day I need to reset all security from a subtree of perhaps 80 Sitecore items. Navigating through the tree I could probably clear the security by hand in about 10-15 minutes, but where is the fun in that, just clicking around.


Instead we had the Sitecore Powershell extensions already installed on the solution, so in just a matter of minutes I had run the following commands and my work was done

$root = Get-Item /path-to-root-item
$children = Get-ChildItem $root.ContentPath -recurse
$children | %{ Reset-ItemField $_ -Field "__Security" -IncludeStandardFields }

So be smart and leverage the tools that are available to you.