Condividi tramite


Exchange 2010/2013 – Using Get-MailboxFolderPermissions to export MAPI permissions of folders for a given mailbox

EDIT : This does NOT work with Exchange 2007 as "Get-MailboxFolderPermissions" is not an available cmdlet on E2007 - Use EWS or PFDavAdmin to get these permissions ...

Thanks Chris, Manfred and friends from the following article:

https://social.technet.microsoft.com/Forums/exchange/en-US/5ad656a5-fe70-477f-a608-0e588096f227/how-to-get-mailbox-folder-permissions-to-all-mailbox-folders-in-all-mailboxes?forum=exchangesvradminlegacy

Manfred Preissner : https://social.technet.microsoft.com/profile/manfred%20preissner/?ws=usercard-mini

 

$SpecialExchangeFolders = "Top of Information Store|Recoverable Items|Deletions|Purges|Versions"

 

 

$CurrentUser = gci env:username | % { $_.value }

 

 

[string[]] $FolderPaths = Get-MailboxfolderStatistics $CurrentUser | % {$_.folderpath}

 

 

$ExchangeFolderPaths = $FolderPaths | % {$CurrentUser + ":" + $_.replace('/','\')}

 

 

$UsableExchangeFolderPaths = $ExchangeFolderPaths | where { $_ -notmatch $SpecialExchangeFolders }

 

 

$UsableExchangeFolderPaths | % { get-mailboxfolderPermission $_ } | ft FolderName, User, Acces sRights, Identity -auto

 

 

 

Result will be like :

 

FolderName                   User      AccessRights
----------                   ----      ------------
Calendar                     Default   {Owner}
Calendar                     Anonymous {None}
Calendar                     User177   {CreateItems, EditOwnedItems}
Calendar                     User1769  {CreateItems, EditOwnedItems}
Calendar                     User1768  {CreateItems, EditOwnedItems}
Calendar                     User1767  {CreateItems, EditOwnedItems}
Calendar                     User1766  {CreateItems, EditOwnedItems}
Calendar                     User1765  {CreateItems, EditOwnedItems}
Calendar                     User1764  {CreateItems, EditOwnedItems}
Calendar                     User1763  {CreateItems, EditOwnedItems}
Calendar                     User1762  {CreateItems, EditOwnedItems}
Calendar                     User1761  {CreateItems, EditOwnedItems}
Calendar                     User1760  {CreateItems, EditOwnedItems}
Contacts                     Default   {None}
Contacts                     Anonymous {None}
Conversation Action Settings Default   {None}
Conversation Action Settings Anonymous {None}
Deleted Items                Default   {None}
Deleted Items                Anonymous {None}
Drafts                       Default   {None}
Drafts                       Anonymous {None}
Inbox                        Default   {None}
Inbox                        Anonymous {None}
Journal                      Default   {None}
Journal                      Anonymous {None}
Junk E-Mail                  Default   {None}
Junk E-Mail                  Anonymous {None}
News Feed                    Default   {None}
News Feed                    Anonymous {None}
Notes                        Default   {None}
Notes                        Anonymous {None}
Outbox                       Default   {None}
Outbox                       Anonymous {None}
Quick Step Settings          Default   {None}
Quick Step Settings          Anonymous {None}
RSS Feeds                    Default   {None}
RSS Feeds                    Anonymous {None}
Sent Items                   Default   {None}
Sent Items                   Anonymous {None}
Suggested Contacts           Default   {None}
Suggested Contacts           Anonymous {None}
Tasks                        Default   {None}
Tasks                        Anonymous {None}

 

Cherry on the cake, visualizing the number of permissions per folder in an Excel graph.

To do so, just copy paste the result above, OR in your script, export the results into a CSV file (Export-CSV can do the trick, as well as Out-File or redirecting “>” into a file, up to you !) and then “Text to columns” Excel menu, then “Format as table” and then “Insert pivot graph”, et voilà :

image

 

This is just an example showing what we can do with Excel and a Cut/n/Paste from Powershell raw data…

Comments

  • Anonymous
    March 06, 2014
    Thanks
  • Anonymous
    May 29, 2014
    Good script thank you...