Is it your mailbox or another mailbox in your organisation? You can only view folders in your own mailbox:
Use the Get-MailboxFolder cmdlet to view folders in your own mailbox. Administrators can’t use this cmdlet to view folders in other mailboxes (the cmdlet is available only from the MyBaseOptions user role).
its indeed a different user. i am having a problem where a certain user needs Editor rights ONLY to the inbox, not the sub folders. i now fixed it like so:
If you’re using Set, that implies they already had some level of permission to the inbox folder. Set will not work otherwise. Add-MailboxFolderPermission only applies permissions to the folder you specify, nothing below it. You can test it to confirm on a mailbox that has no special permissions set. Set-MailboxFolderPermission only modifies the permission on the folder you specify, not the sub folders either. I suspect those permissions were already set and you are thinking your command Set-MailboxFolderPermission applied permissions to the sub folder when it actually did not.
true, but Set-MailboxFolderPermission throws an error if no prior permission was set, so thats okay And since i want to remove any prior permissions, Set-MailboxFolderPermissions is the right command
I think you missed my point - though to be fair - I didn’t clearly state what my point was. Apologies for that. Whether intentional or not, your post implies (at least to me) that your initial set command is applying permissions at a lower level, thus requiring you to loop through those folders to remove those ‘extra’ permissions. My post was really to say, no it’s not doing that. If you want to remove permissions on each folder, you have to loop through the folders.
Additionally, ‘easier way’ is subjective, and could be open to multiple interpretations. It felt like you were stating that it shouldn’t be necessary to loop through the folders.
So the takeaway is, avoid making blanketed statements such as ‘there should be an easier way’. State what you don’t like about your solution or what the issue is so we can assist. Otherwise, we’re forced to make assumptions based on your comment . Again I do apologize for not clearly stating what my point was there, and also if I reached the wrong reason for why you were asking for an easier way.
Personally, I don’t care what you use to check/remove permissions. All i know is I hate seeing ‘red text’ if it can be avoided, especially if I write code for others. It’s better to handle (ideally) or ignore those errors properly instead of just letting them accumulate on screen. In any case, I really didn’t talk about that
My head is too full atm, so i have a hard time understanding things, no worries there
The problem i am trying to solve is this: User A needs access to the Inbox of user B, but not to the sub folders of the inbox. Since they messed with the permissions themselves, i have no way of knowing which subfolder User A has access to, if they have access at all.
To be fair, i learned yesterday that granting permission to the inbox does not automaticly grant access to the sub folders, so thats one less worry in case i have to do this for a “new” user. But for the old users i still need to remove any permission to any subfolder they may currently have