Trying to put a script together where I can put a list of people into a CSV file (like 1 column), and then run a script that for everyone in the list, it will add full mailbox permissions as well as Send As permissions.
Here's what I got but it appears to ignore the users that are in the CSV file and proceeds to try to run the script for everyone in the Exchange database instead:
$Thelist = Import-csv "H:\LoopList.csv"
ForEach ($theobject in $thelist)
foreach ($theobject2 in $thelist)
$theMBDN = (Get-Mailbox $theobject2.themailbox).distinguishedname
Add-ADPermission $thembDN -Extendedrights “Send As” -User $theobject.theuser
Add-MailboxPermission $thembDN -Accessrights “FullAccess” -User $theobject.theuser
Something I am missing here?