Created
February 21, 2019 13:41
-
-
Save mardahl/e9ac56f1802e91614a87e6c6c1064515 to your computer and use it in GitHub Desktop.
Set Office 365 Room Mailbox Calendar permissions and processing defaults, so subject and meeting organizer is visible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Connect to Office 365 Exchange (wont work if MFA is required. | |
#Use conditional access or whitelisting to allow the connection without MFA | |
$LiveCred = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
#Get list fo All Room type mailboxes | |
$rooms = Get-MailBox | where {$_.ResourceType -eq "Room"} | |
#Set permissions and processing defaults on alle Room type mailboxes | |
foreach ($room in $rooms){ | |
$calName = $room | Get-MailboxFolderStatistics -FolderScope calendar | select-object Name | |
write-host "Setting requested default permissions on: $($room.Identity):\$($calName.Name)" -ForegroundColor Yellow | |
Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity "$($room.Identity):\$($calName.Name)" -User default | |
Set-CalendarProcessing -Identity "$($room.Identity)" -AddOrganizerToSubject $true -DeleteComments $false -DeleteSubject $false | |
Write-Host "Done" -ForegroundColor Green | |
Write-Host | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment