I thought that easy, when you have just 2 or 3 folders. How about 100 folder, it is still easy though if you know the script.
Get-MailboxFolderStatistics Mailboxname | where{ $_.folderpath -eq “/Foldername”) | Add-MailboxFolderPermission Mailbox -User Username -AccessRights “Level of access”
Unfortunately the above command won’t work. I found a script in a blog,
- Get-MailboxFolderStatistics Username – This gives the list of folders
- Filter a specific folder and it subfolder which needs access, where{ $_.folderpath.Contains(“//Foldername”)
- Assign permission Add-MailboxFolderPermission Mailbox -User Username -AccessRights “Level of access”
Putting al together
foreach( $Folder in (Get-MailboxFolderStatistics username | where{ $_.folderpath.Contains(“/Foldername”) -eq $true } ))
{
$FPath = “Mailbox Name:” + $Folder.folderpath.replace(“/”,”\”);
Add-MailboxFolderPermission Mailbox -User Username -AccessRights “Level of access”
}
- Foreach is to help choose each folder and assign permission.
- $FPath = “Mailbox Name:” + $Folder.folderpath.replace(“/”,”\”) – This is to get the complete path of the subfolder
Thanks,
Vijay