Script - How to enumerate/export, to .CSV, shared Folder/Subfolders Security permissions

It is important to verify shared folder permissions to find any misconfiguration.

I found an interesting script that easily enumerates all shared folders and it creates a .csv file (for reporting purposes).

Here it is relative script and link:

This powershell script enumerates all folder and subfolders permissions of a folder and exporting it to ,csv file.

An alternative article (that I did no test)