This example covers the migration path to Azure AD app-only with a certificate, which is the recommended replacement. See https://learn.microsoft.com/en-us/sharepoint ...
Inspired by Report-PermissionsFolderLevel.PS1 from Office 365 for IT Pros. ctx: Authenticated ClientContext. folder_url: Server-relative URL of the folder to scan. indent: Nesting level for display.