Continuing the Permissions inventory series, I’ve published two more scripts on the TechNet Gallery. Both scripts deal with mailbox folder permissions, in the first case only covering the default Calendar folder.
Both scripts use much of the same code, after all getting the permissions is performed via the Get-MailboxFolderPermission cmdlet. For the Mailbox folder permissions inventory script however, the number of folders covered and thus the number of permission entries gathered is much larger, so some additional optimizations have been made in the code. This includes arrays to specify which folders to cover and which to exclude, as well as a parameter to exclude permission entries from specific users. I’d recommend adjusting those accordingly, especially if you try to run the scripts in large organizations.
Unlike previous scripts in the series, output is written to a CSV file by default – seems I’m the only one that prefers to actually take a look at the output before dumping it to file 🙂 Feedback taken! The scripts will still keep the output in the global $varPermissions variable, in case you want to manipulate it before export. And in case you are having troubles with the session breaking too often, an alternative is provided in order to save the output after each script iteration.
And since we mentioned output – two different variants are included. The default one writes each permission entry to a new line in the CSV file, but you can also use the -CondensedOutput switch to specify that you want to get the “shorter” version, with one line per mailbox folder (or one line per mailbox in the case of the Calendar Permissions script). Examples below, let me know which one you prefer.
Anyway, here are the links to the scripts and more detailed descriptions on the Cogmotive blog site: