



# Get all mailboxes
$Delegates = Import-Csv "\\nopmgr1\g$\CM Storage\Migration Batches\Done CSV\Migration_Batch1_310_Users.csv"



$delegates | % {

 Get-Mailbox $_.ImportName | Get-MailboxPermission | 

?{ ($_.AccessRights -eq "FullAccess") -and ($_.user -like "*ons\*")-and -not ($_.AccessRights -like "*read*", "*DeleteItem*" , "*Change*")`
 -and -not ($_.user -like "*ONS\laker2_admin*" -or $_.user -like "*ONS\NotesAdmin*") } |
 
  select @{Name='Name';expression={(Get-Recepient $_.User).Displayname}}, accessrights, identity | Export-Csv C:\Scripts\Output\SendonBehaft.csv -NoTypeInformation -Append


#AccessRight -fullAccess   
               

}