I copied this from Victoria Yudin's blog, because it's too important to not to be able to find again. If you work on/in/under Dynamics GP, you need to subscribe to this.
This script shows all security roles, tasks and detailed resource descriptions by user by company