Get sites, webs, lists and number of items with their permission inheritance in SharePoint

Working with permissions in SharePoint can become complicated very quickly. Especially when you are starting to break the inheritance on several levels. Finding out which sites and lists have their inheritance broken is a task which can set you back a few hours, depending on the size of your SharePoint environment.
Since I’m always short of time and don’t like doing things manually, I made my life a little less complicated and just scripted it. This gives me a nice CSV output which I can pull into Excel and voila… instant report! PowerShell still rulez! 😎
Here’s the script.