Link to home
Start Free TrialLog in
Avatar of Andy Andy
Andy AndyFlag for India

asked on

Mailbox Folder permission on all folders and subfolders

Hello Team,

Can you please guide me how to give MailboxFolderpermission on folder and thier subfolders in one go to one user with accessrights suppose we take Owner.

Thanks,
andy
Avatar of Amit
Amit
Flag of India image

You can give full mailbox permission. That will automatically provide permission on all Folders.
Avatar of Andy Andy

ASKER

this is not i am looking for.. i need in inbox, only particular scripts sub-folder can take permissions
i am using below command, which is working fine. i need it read only one particular folder in inbox and give permission to user on all subfolders in it..

ForEach($f in (Get-MailboxFolderStatistics "ngupta2" | Where { $_.FolderPath.Contains("/Inbox") -eq $True } ) ) { $fname = "ngupta2:" + $f.FolderPath.Replace("/","\"); Add-MailboxFolderPermission $fname -User "vchiu" -AccessRights Reviewer }
in inbox there is one subfolder and in that sub folder there are many subfolder.
so i need. it skip the inbox and give the necessary permissions to subfolder that i want.. if this get succedd. then the subfolder that having many subfolders it will automatically came
Andi,
Explain to me what you are trying to do exactly and i will give you the correct command.  Does  userx need full permissions on usery's mailbox?
Add-MailboxFolderPermission -Identity emailaddressofthemailboxbeingaccessed:\NameofFolderyouneedtoaccess -User emailaddressofuseraccessing -AccessRights Owner
Hello Foxluv,

I will give you the Example.. Suppose i have parent folder Inbox ..OK... and in INBOX-->Test....OK
and Test having further sub folders

Now i want user X can have permission on user y mailbox on Test Folder and thier subfolders.... not all the folders in Inbox.... only Test and subfolders in it.

i run the command for inbox only and it is working perfectly fine.. and it giving permission to all subfolders in it... But my question in 1st paragraph is little different.

Hope this clarify you, i use below command.. i am not script master..so need help in this.

ForEach($f in (Get-MailboxFolderStatistics "userx" | Where { $_.FolderPath.Contains("/Inbox") -eq $True } ) ) { $fname = "userx:" + $f.FolderPath.Replace("/","\"); Add-MailboxFolderPermission $fname -User "usery" -AccessRights Reviewer }
Very well you  can use the command I left you above.

Add-MailboxFolderPermission -Identity usery@domain.com:\Test -User userx@domain.com -AccessRights Reviewer
your is normal command.. this is somethign tricky one.. please see my comment
I think you are making this more complex then it needs to be. I beleive that I also provided an answer on another question as well regarding this. However you can do this using the syntax below....

For a single mailbox
Get-MailboxFolder -Identity user1:\inbox -recurse | add-mailboxFolderPermission -User user2 -AccessRights owner

Open in new window


For muultiple users
$User = "Administrator"
$Mailboxes = Get-Mailbox -ResultSize "unlimited"

ForEach ($Mailbox in $Mailboxes) 
    {
        
        Get-MailboxFolder -Identity $Mailbox":\Inbox" -recurse | add-mailboxFolderPermission -User $User -AccessRights owner
        
}

Open in new window


That should be all that is required.

Will.
Andi, this is a very simple basic command which I have supplied you.  Is this command necessary for one user or do you need many users to have access to the subfolder?
The way to accomplish this is by using the Get-MailboxFolder -Recurse switch and PIPING it to ADD-MAILBOXFOLDERPERMISSION which will get all of the subfolders under INOBX. it will then add the permissions to each folder. I have just tested this exact scenario in my lab and it works without any issue. I have used my exact script i have provided above.

Will.
Andi,
You can use Will's script but being that you don't need the inbox put the name of your subfolder after the backslash in his script

:\NameofSubfolder
Hello Will,

Get folder is not working on power shell.. your command is good yesterday that i asked in another question.

But here i asked somethign different... i dont need inbox.. i need the subfolder of it.

Please see my command in above comments.
i am just not able to make it as a subfolder instead of Inbox.

Hope this clarifies for both expert

Thanks,
Andy
Get mailbox folder is not working.. normally.. it showing mailbox does not exist.. but i can see all folders of mine.. when i run Get-Mailboxfolder command

Dont know,, if this is something due to any RBAC

Thanks
Are you doing this in Exchange Management shell and do you have the proper permissions?
hello fox

I run below command ..it did not run successfully

Get-MailboxFolder -Identity ngupta2:\scripts -recurse | add-mailboxFolderPermission -User vchiu -AccessRights owner

scripts is the subfolder in inbox
i am using windows powershel.. i am having rights..
i am in exchange 2013 environment
Are you in the exchange management shell or just regular windows powershell?
I want you to run the command Get-excommand and let me know if you get a list of exchange commands.
it is showing unrecognized commmand......
That's what I thought.  You need to run the command from exchange management shell
If it isn't installed on that machine you can run the exchange install cd and just install the management tools, that will install the exchange management console and the exchange management shell on that machine you are using.
i think you are not getting me.. there is no Exchange 2010 in my environment.. it is only Exchaneg 2013
and i usually do all administrative task using Windows Power shell.
Hopefully this works for you and we are all on the same page here...

$User = "Administrator"
$Mailboxes = Get-Mailbox -ResultSize "unlimited"

ForEach ($Mailbox in $Mailboxes) 
    {
        
        Get-MailboxFolder -Identity $Mailbox":\Inbox\WhateverSubFolder" -recurse | add-mailboxFolderPermission -User $User -AccessRights owner
        
}

Open in new window


I have modified my original script. it should be \inbox\whateverSubFolder and use the -recurse switch to get all of the folders under the "WhateverSubFolder" you have specified.

Will.
in this where i need to mentioned identity user and user on which permission need to be applied
Will, please help..w e are very near to resolution

I really appreciate your efforts in this.. i really need to accept the solution...i need closing comments now..

thank you

thanks,
Andy
Will,

Can you please update the thread
Andy,

I am not sure what more you are looking for?

Please let me know.

Will.
in your last update. where i need to mention the user i want to give permission and to which user it would be get assigned
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Will, You are Superrrr ...

It works like a Charm !!

Thanks you so much for all your support.... How can i specially request my questions to you.. Because what i see.. i get Response from Engineers very slow..

You are Really Awsum !!

Thanks,
Andy
I want to give Speciall thanks to Will.
His work is Really commendable.. Every time he comment.. he gives one linner solution not moving his cursor here n there..

If i would get this kind of support from Experts-exchange.. I would be happy registered by myself for more years.. Even i am recommending for this Site to other users as well.. !!

Because I am Happy

Thnx
Thank you for that appreciate it <3 follow and support!

Will.