Forum Discussion

JeremyTBradshaw's avatar
JeremyTBradshaw
Iron Contributor
Aug 23, 2023

FolderId's not unique without factoring in case-sensitivity, PowerShell issues...

Hello, I like using Get-/Set-/Add-/Remove-MailboxFolderPermission cmdlets.  One of my favorites.  There are times when there are special characters in the folder names, so I use the FolderId instead.  For example:

 

Add-MailboxFolderPermission -Identity "User1:LgAAAAC5KVkA/5dLTL13II/kvsaqAWCosJLoiFIBRbYcQ3Ny3l9TAAAAfag/AAAB" -User "User2" -AccessRights FolderVisible,ReadItems

 

This has been fantastic to save the day in those cases.

 

My latest issue though is that there turn out to be many duplicate FolderId's if we disregard case-sensitivity.  If I import a CSV which has UN-tampered FolderId's (case-preserved and confirmed) with Import-Csv, and then to this:

 

Add-MailboxFolderPermission "User1:$($csv[0].FolderId)" -User "User2" -AccessRights FolderVisible, ReadItems

 

 ... the actual folder to be updated with this new permission entry (ACE) may be the one I intended, or it may be one of the other folders with a matching FolderId (ignoring case-sensitivity).

 

What I've found is that it is possible but difficult to bounce back from that problem state.  You need to report all permissions before and after and verify the differences are only the intended changes.  Super tedious, effectively a dangerous exercise overall.

 

I don't see any alternative solutions for this problem.  MFCMAPI I think, as well as Outlook/OWA, are definite workarounds.  Wondering if there is anything in-built with the *-MailboxFolderPermission / *-MailboxFolderStatistics cmdlets that can help PowerShell here?

1 Reply

Resources