so I recently have been working around the task of thinning out the number of inactive DL's we have in O365 and I stumbled upon this set of 3 scripts made by u/ascIVV
on reddit which was posted on several subreddits. and after going through the script to make sure it was safe and that I understood how it works so I could fix and and tune it for our needs if required I then tested it and it worked, though I was using a global admin account which is not entirely best practice I have heard for scripts that run regularly on their own, so I decided I would make an account that had the bare minimum required permissions to run the script, however upon making this account and trying to run it with just the Exchange Administrator Role I found out that the script would throw some errors so I assume I am missing some roles. so that leads me to my question, what would be the best way to go about figuring out what roles are required for the cmdlets being used in a script and then assigning them to a user.
here is the GitHub repo where the original script lives
ascivv/DLActivityScripts (github.com)
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.