Hello guys, i would like to get some advice, how to remove mailbox folder permission for usertype Unknown in ExchangeOnline
I am connected to exchange online via PS with prefix EO as Exchange Online, so cmdlets will start with EO, because we have hybrid environment and i need to manage both in one PS.
I have shared mailbox, where is some corrupted ACL for user group, which i want to remove.
[PS] C:\ExchangeScripts\ExchangeOnline\Resource Migration>(Get-EOMailboxFolderPermission "Mailbox") | select -ExpandProperty user
UserType RecipientPrincipal DisplayName
Default Default
Anonymous Anonymous
Unknown %GroupName%
so i am able to select this unknown UserType:
Get-EOMailboxFolderPermission -identity "Mailbox" | where {$_.user.usertype -like "unknown"}
But i cannot remove this rights, through pipeline:
Get-EOMailboxFolderPermission -identity "Mailbox" | where {$_.user.usertype -like "unknown"} | Remove-EOMailboxFolderPermission
Cannot process argument transformation on parameter 'User'. Cannot convert value "GroupName" to type "Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter". Error: "Cannot convert hashtable to an object of the following
type: Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter. Hashtable-to-Object conversion is not supported in constrained language mode, restricted language mode or a Data section."
- CategoryInfo : InvalidData: (Microsoft.Excha...olderPermission:PSObject) [Remove-MailboxFolderPermission], ParameterBindin...mationException
- FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-MailboxFolderPermission
- PSComputerName : outlook.office365.com
I dunno, why it returns that error described upper....
Do you have any ideas how to deal with it?
Thanks you
D.