The script checks public folders client permissions for missing entries for Default and Anonymous user roles. 

If Default user is missing, fixes it by putting Default back with Access Rigts set to FolderVisible.   

If Anonymous user is missing, fixes it by putting Anonymous back with Access Rights set to None. 

Script has been successfully used with Exchange 2016