Recursive Mailbox Full Permission Report Using PowerShell


exchangeMailbox Permissions may include Users and Groups, and sometimes even nested groups. And if you were tasked to get a report listing all those permissions, it would be a very tedious process to manually look up each entry. This script can help generate the needed report based on a file with a list of mailboxes are input file, all mailboxes, or just a single mailbox.



The Script

Variables

Variables

Depending on what your requirements are, you can change the value of the variable $mailboxList. The descriptions are already stated after each option.

Input File for Option 1

Should you choose OPTION 1, which is to use an input file named mailboxlist.txt, the file must first exist and contain the list of the acceptable identity values like SamAccountName, PrimarySMTPAddress, Alias or UserPrincipalName to name a new.

The example below shows the file containing the PrimarySMTPAddress values.

Running the Script and the Outputs

Running the script requires no parameters. All you need to do is run it in your normal PowerShell session (not EMS or Remote Shell).

On Screen

The screen output shows which mailboxes are currently being processed. Each permission will be listed below the current mailbox, and the mailbox with no permissions found will be skipped.

Debug Log

The Debug Log is just a transcript of what was displayed on the screen. The filename format is DD-MMM-YYYY_HH-MM-TT_debuglog.txt and is saved in the same folder as the script itself.

CSV Report

A report in CSV format is exported and saved in the same folder as the script itself. It will always be named “report.csv” and will be overwritten each time the script is executed successfully.

CSV Report Fields

  • MailboxName
    • Name of the mailbox
  • MailboxEmailAddress
    • Email address of the mailbox
  • WhoHasAccessName
    • Name of the user who has access to the mailbox
  • WhoHasAccessEmailAddress
    • Email address of the user who has access to the mailbox
  • AccessType
    • DirectUser – means that the user has direct access permission applied to the mailbox
    • InheritedFromGroup – means that the user has permission because the user is a member of a group that has access to the mailbox
  • ParentGroupName
    • Name of the group that has access to the mailbox
  • ParentGroupEmailAddress
    • Email Address of the group that has access to the mailbox


Download Link

https://github.com/junecastillote/Get-RecursiveFullPermission

Share:

No comments:

Post a Comment

Popular Posts

Powered by Blogger.