1 2 3 4 5 6 7 8 |
$new-user="myusername" $old-mailbox="old-mailbox" $folder-name="virus" ForEach($f in (Get-MailboxFolderStatistics $old-mailbox | Where {$_.FolderPath.Contains($folder-name) -eq $True } ) ) { $fname = $old-mailbox+":" + $f.FolderId; Add-MailboxFolderPermission $fname -User $new-user -AccessRights Owner } |