My company recently went through a rebranding and we had to update our company name on the additional response test on some 300+ conference rooms in our Exchange Hybrid environment. As always, PowerShell came to the rescue! In order to do this we took the following high level steps:
- Get all mailboxes of the RecipientTypeDetails type of RoomMailbox
- Get the Calendar Processing properties of each
- For each mailbox with a filled in AdditionalResponse, replace the old text with new text
- If there was a difference between the AdditionalResponse and the new one, then set the mailbox’s AdditionalResponse for the new one, if not then take no action
- Add the results to an array for reporting purposes
Code below (note that this can work for either Exchange On premises or Exchange Online)
$report = [System.Collections.ArrayList]@()
#Exchange On prem
$ConferenceRooms = Get-Mailbox -Filter "RecipientTypeDetails -eq 'RoomMailbox'" -ResultSize Unlimited |
Get-CalendarProcessing |
Where-object AdditionalResponse -ne $NULL
#EXchange Online
$ConferenceRooms = Get-ExoMailbox -Filter "RecipientTypeDetails -eq 'RoomMailbox'" -ResultSize Unlimited |
Get-CalendarProcessing |
Where-object AdditionalResponse -ne $NULL
$ConferenceRooms |
Foreach-object {
$AddtoReport = [PSCustomObject]@{
Identity = $_.Identity
PreviousResponse = $_.AdditionalResponse
NewResponse = ""
Result = "UNKNOWN"
}
$FixedMessage = $_.AdditionalResponse -replace "Contoso\s",'LakeView '
if ($FixedMessage -ne $_.AdditionalResponse) {
Try {
$AddtoReport.NewResponse = $FixedMessage
Set-CalendarProcessing -Identity $_.Identity -AdditionalResponse $FixedMessage -erroraction top
$AddtoReport.Result = "FIXED"
}
Catch {
$AddtoReport.Result = "ERROR : $($_)"
}
}
Else {
$AddtoReport.Result = "NO CHANGE NEEDED"
}
$report.add($addtoreport) |
out-null
[GC]::Collect()
}