1

I'm in the process of migrating a school domain from Exchange 2016 to Exchange Online (Full Hybrid). I've noticed that in Outlook on the web, users are able to right click their inbox (or any other mailbox folder), click Permissions and give other users read and write access to their folders. I want to prevent pupils from accessing this feature, or at least prevent them from adding permissions/sharing their folders (I.e. read only access). Unfortunately, pupils occasionally enjoy trying to delete each other's work etc so I think it's best they don't have access to folder permissions.

Mailbox Folder Permissions

From my research I have found that anything which isn't covered by an Owa Mailbox Policy can be controlled using RBAC (I.e. Role Based Access Control). So I set up and assigned a policy to a test account and removed access to the Add-MailboxFolderPermission, Remove-MailboxFolderPermission and Set-MailboxFolderPermission cmdlets as shown below.

Connect-ExchangeOnline
New-ManagementRole -Name "MyBaseOptions-ForPupils" -Parent "MyBaseOptions"
New-RoleAssignmentPolicy -Name "Test Pupil Role" -Roles "MyBaseOptions-ForPupils", "MyMailSubscriptions"
Get-Mailbox -Identity [email protected] | Set-Mailbox -RoleAssignmentPolicy "Test Pupil Role"

Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Add-MailboxFolderPermission"
Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Set-MailboxFolderPermission
Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Remove-MailboxFolderPermission"

This didn't work, so I also tried removing the following cmdlets to see if it would remove access to the Permissions feature altogether, but wasn't sure if this would cause any problems.

Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Get-MailboxFolderPermission"
Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Get-EXOMailboxFolderPermission"

I haven't noticed any problems, but the feature is still accessible and the test account can still add, edit and remove folder permissions. I have checked that the cmdlets I have removed are not in the MyMailSubscriptions role (which I also assigned to the test account) and they are not.

As a test I ran the following commands and the Auto Reply settings disappeared from the UI a few minutes later, so the policy has definitely applied.

Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Get-MailboxAutoReplyConfiguration"
Remove-ManagementRoleEntry -Identity "MyBaseOptions-ForPupils\Set-MailboxAutoReplyConfiguration"

I also authenticated PowerShell as the test account I.e. Connect-ExchangeOnline -UserPrincipalName [email protected] and confirmed that the account is not able to access the cmdlets which I removed.

Is anybody able to tell me how to get this working please, or if it is even possible?

EDIT:

In response to Ivan_Wang's answer. The command you asked me to run returns an error converting Identity to a RoleEntryIdParameter. The way I have been checking this myself is by running:

Get-ManagementRoleEntry "MyBaseOptions-ForPupils\*" | where { $_.Name -like "*MailboxFolderPermission*" }

Which returns nothing. If I widen the query slightly to *MailboxFolder* I get:

Get-ManagementRoleEntry "MyBaseOptions-ForPupils\*" | where { $_.Name -like "*MailboxFolder*" } | ft Name

Name
----
Get-MailboxFolder
New-MailboxFolder

Also tried *Permission*:

Get-ManagementRoleEntry "MyBaseOptions-ForPupils\*" | where { $_.Name -like "*Permission*" } | ft Name

Name
----
Get-SenderPermission

Hopefully that answers your question. As for your second question, I have only ticked the child role as shown below:

Selected Roles

1 Answer 1

0
  1. What's the result if you run the following command which is used to check if the custom role still has the role entry MailboxFolderPermission?

Get-ManagementRole "MyBaseOptions-ForPupils" | Get-ManagementRoleEntry | where{$_.Name -like "*MailboxFolderPermission*"}

enter image description here

  1. Did you select the parent role which has the child role MyBaseOptions-ForPupils?

"If you select a check box for a role that has child roles, the check boxes for the child roles are also selected. If you clear the check box for a role with child roles, the check boxes for the child roles are also cleared.". Source

2
  • Thank you for your answer. I have updated my question to show what you are asking.
    – Daniel
    May 11, 2021 at 10:20
  • Thanks for your output. I will use your configuration to test the role entry in my environment and report the result after the task finishes.
    – Ivan_Wang
    May 14, 2021 at 5:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .