Score:0

How to set-mailboxfolderpermission with import-csv

tc flag

I want to import bulk zoom from CSV file.

The csv file format: name,email,capacity

And I create the room with the script as below:

$roomlist = import-csv roomlist.csv

foreach($room in $roomlist){
New-Mailbox -Alias $room.email -Database MBX01 -Name $room.name -OrganizationalUnit “Domain/Users” -ResourceCapacity $room.capacity -room
Set-mailboxfolderpermission -identity "${room.name}:\Calendar" -AccessRights Reviewer -User Default
}

The zoom creating was success, but fail on Set-mailboxfolderpermission. How could I fix it?

Error Message

Score:0
pl flag

Modify this row from:

Set-mailboxfolderpermission -identity "${room.name}:\Calendar" -AccessRights Reviewer -User Default

to:

Set-mailboxfolderpermission -identity "$($room.name):\Calendar" -AccessRights Reviewer -User default

And see if it helps.

alvinshih avatar
tc flag
It's work! Thanks for your big help.
Kael avatar
pl flag
Glad to help! Please accept it as the answer if it helps with this question.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.