Why Remove-MailboxFolderPermission fails if user specified in User property doesn't have any mailbox?

Volodymyr Dumchykov 41 Reputation points
2023-09-20T07:31:27.8066667+00:00

ExoModuleVersion: 3.2.0

Problem:  Remove-MailboxFolderPermission cannot remove permission if the user specified in User property doesn't have any Exchange Online mailbox. The cmdlet fails with the following error: 

|Microsoft.Exchange.Management.StoreTasks.UserNotFoundInPermissionEntryException|There is no existing permission entry found for user:103ac2ac-42e3-4797-af94-bd13d4c69a9c.

Where '103ac2ac-42e3-4797-af94-bd13d4c69a9c' is the ID of the user that I specify in -User parameter.

If I specify the user's display name, then the cmdlet removes the permission correctly, but display name cannot be used because it is not unique and cannot identify the user correctly.

Microsoft Exchange Online
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,272 questions
{count} votes

Accepted answer
  1. Vasil Michev 99,351 Reputation points MVP
    2023-09-20T17:40:20.5266667+00:00

    Can you show us the output of Get-MailboxFolderPermission for that entry? In particular, the properties of the User object, for example:

    Get-MailboxFolderPermission user:\calendar | Select -ExpandProperty User

    If the UserType value returned therein does not show "Internal", Exchange has no knowledge of the corresponding security principal, and using the GUID value will result in an error similar to the above.

    If you do see non-null RecipientPrincipal object returned, you can use identifiers therein to reference the user.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful