# Help Bulk Permission changes O365  Conferance Rooms

**URL:** <https://forums.powershell.org/t/help-bulk-permission-changes-o365-conferance-rooms/2715>\
**Category:** PowerShell Help\
**Created:** [June 17, 2014, 12:37pm UTC](https://forums.powershell.org/t/help-bulk-permission-changes-o365-conferance-rooms/2715 "2014-06-17T12:37:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sysadjt](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@sysadjt](https://forums.powershell.org/u/sysadjt)\
**Post date:** [June 17, 2014, 12:37pm UTC](https://forums.powershell.org/t/help-bulk-permission-changes-o365-conferance-rooms/2715/1 "2014-06-17T12:37:46Z")

</div>

I am very new to PowerShell and trying to set permissions on our Conference rooms that have just been migrated from 2010 Exchange to O365.  
I what to run the powershell command.

Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity Room:\calendar -User default

on all of our Conference rooms but i am not sure how to pass -identity to powershell to edit all Conferance rooms i have tried

Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity (Get-Mailbox | where {$\_.resourcetype -eq"room"} | Select -Expandproperty primarysmtpaddress):\calendar -User default

i know that -identity is looking for MailboxFolderUserIdParameter and the cmd i am passing is giving it a string value just now sure where to go.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![bucky-koehler](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bucky-koehler](https://forums.powershell.org/u/bucky-koehler)\
**Post date:** [June 17, 2014, 2:12pm UTC](https://forums.powershell.org/t/help-bulk-permission-changes-o365-conferance-rooms/2715/2 "2014-06-17T14:12:04Z")

</div>

I don’t recommend using a one-liner on scripts of this nature, as it’s easier to troubleshoot and understand what’s going on with variables. I added a -WhatIf for safety; run the first time to verify it’s what you’d want to do, then run just the foreach loop the second time without the -whatif to change permissions.

```
#Get a list of rooms
$list = Get-Mailbox -ResultSize Unlimited | where {$_.resourcetype -eq "room"}; $list
 
#For each room get the calendar permissions, isolate the default user, and verify the permissions, changing if not what is desired.
 
foreach($mbx in $list){
	$CalendarPermission = Get-MailboxFolderPermission -Identity "$($mbx.UserPrincipalName):\calendar"
	$default = $CalendarPermission | where{$_.User.DisplayName -eq "Default"}
	if($default){
		if($default.AccessRights -ne "LimitedDetails"){Set-MailboxFolderPermission -Identity "$($mbx.UserPrincipalName):\calendar" -User Default -AccessRights "LimitedDetails" -Whatif}
		Clear-Variable default
	}else{"No default user found for $($mbx.UserPrincipalName)"}
}
```

Edit: Added an if($default) on the off chance someone removed the default user  
Edit: Added -ResultSize Unlimited in case you have over 1000 mailboxes

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:47pm UTC](https://forums.powershell.org/t/help-bulk-permission-changes-o365-conferance-rooms/2715/3 "2024-05-16T20:47:55Z")

</div>


