Garry Shape
asked on
Exchange Powershell - Importing CSV question
I have this code here that will let me specify mailboxes in one column and the users who can be granted access to that mailbox in the other column:
But lets say I want 6 different users to have access to each other's mailboxes.
Instead of repeating each user's mailbox 6 times in the TheMailbox column, can I just put each person's mailboxname once in both columns, and have a script that loops through each one until each person has accesss to eachother's mailbox?
I attached the current CSV I'm working with so show you the redundancy I'm trying to eliminate.
$Thelist = Import-csv “H:\MailboxAccess.csv”
ForEach($theobject in $thelist) {$theMBDN = (Get-Mailbox $theobject.themailbox).distinguishedname;
Add-ADPermission $thembDN -Extendedrights “Send As” -User $theobject.theuser;
Add-MailboxPermission $thembDN -Accessrights “FullAccess” -User $theobject.theuser
But lets say I want 6 different users to have access to each other's mailboxes.
Instead of repeating each user's mailbox 6 times in the TheMailbox column, can I just put each person's mailboxname once in both columns, and have a script that loops through each one until each person has accesss to eachother's mailbox?
I attached the current CSV I'm working with so show you the redundancy I'm trying to eliminate.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER