$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 }