Exchange 2010 – All access rights from all mailbox folders

Let’s try this request:22-03-2013 19-42-05
Get all access rights for all mailbox folders.

We should use cmdlet Get-MailboxFolderPermission which requires declaration like alias:\Inbox\folder. So we need only another cmdlet Get-MailboxFolderStatistics and convert slash characters in its folderpath property.

PS] C:\>$folders = Get-MailboxFolderStatistics filip | %{$_.folderpath} | % {$_.replace("/","\")}

[PS] C:\>$folders[7..11]
\folder 0
\folder 0\folder ? test
\folder 0\folder 1
\folder 0\folder 1\ffolder2
\folder 0\folder 2

22-03-2013 20-51-29We should have all folder paths from the mailbox (filip = alias) in $folders variable and be able to use it for Get-MailboxFolderPermission. We can expect few errors for “system” folders such as Top of Information Store, Recoverable Items, Deletions, Versions, Purges but also for folders which contains the slash character in name because of converting.

[PS] C:\>$folders = $folders | %{ Get-MailboxFolderPermission "filip:$_" | select foldername,user,accessrights}`
 | ? { $_.AccessRights -notlike "None" -and $_.User -notlike "*filip*" }

The operation couldn't be performed because 'filip:\Top of Information Store' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : 28783069,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

The operation couldn't be performed because 'filip:\folder 0\folder ? test' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : 18857875,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

The operation couldn't be performed because 'filip:\Recoverable Items' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : ABE546E,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

The operation couldn't be performed because 'filip:\Deletions' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : 8321BED7,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

The operation couldn't be performed because 'filip:\Purges' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : 65847762,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

The operation couldn't be performed because 'filip:\Versions' couldn't be found.
 + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
 + FullyQualifiedErrorId : 8A11CF7B,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission

Valid objects are in the folders variable:

22-03-2013 20-49-14

Shortly:

  1. $folders = Get-MailboxFolderStatistics alias | % {$_.folderpath} | % {$_.replace(“/”,”\”)}
  2. $folderPermissions = $folders | %{ Get-MailboxFolderPermission “alias:$_” | select foldername,user,accessrights}
  3. $folderPermissions