Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#522 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to hotfix for caldefaults and standard saving pre-migration
  • Loading branch information
KelvinTegelaar authored Dec 11, 2023
2 parents 499ee3a + f2818eb commit 2494cc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Function Invoke-AddStandardsDeploy {
try {
$Tenants = ($Request.body | Select-Object Select_*).psobject.properties.value
$Settings = ($request.body | Select-Object -Property *, v2* -ExcludeProperty Select_*, None )
$Settings.v2 = $true
$Settings | Add-Member -NotePropertyName 'v2.1' -NotePropertyValue $true -Force
foreach ($Tenant in $tenants) {

$object = [PSCustomObject]@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ function Invoke-CIPPStandardcalDefault {
$Mailboxes = New-ExoRequest -tenantid $Tenant -cmdlet 'get-mailbox'
foreach ($Mailbox in $Mailboxes) {
try {
New-ExoRequest -tenantid $Tenant -cmdlet 'Get-MailboxFolderStatistics' -cmdParams @{identity = $Mailbox.UserPrincipalName; FolderScope = 'Calendar' } -Anchor $Mailbox.UserPrincipalName | ForEach-Object {
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-MailboxFolderPermission' -cmdparams @{Identity = ($_.identity).replace('\', ':\'); User = 'Default'; AccessRights = $Settings.permissionlevel } -Anchor $Mailbox.UserPrincipalName
Write-LogMessage -API 'Standards' -tenant $tenant -message "Set default folder permission for $($Mailbox.UserPrincipalName) to $($Settings.permissionlevel)" -sev Error

New-ExoRequest -tenantid $Tenant -cmdlet 'Get-MailboxFolderStatistics' -cmdParams @{identity = $Mailbox.UserPrincipalName; FolderScope = 'Calendar' } -Anchor $Mailbox.UserPrincipalName | Where-Object { $_.FolderType -eq 'Calendar' } | ForEach-Object {
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-MailboxFolderPermission' -cmdparams @{Identity = "$($Mailbox.UserPrincipalName):$($_.FolderId)"; User = 'Default'; AccessRights = $setting.permissionlevel } -Anchor $Mailbox.UserPrincipalName
Write-LogMessage -API 'Standards' -tenant $tenant -message "Set default folder permission for $($Mailbox.UserPrincipalName):\$($_.Name) to $($setting.permissionlevel)" -sev Error
}
} catch {
Write-LogMessage -API 'Standards' -tenant $tenant -message "Could not set default calendar permissions. Error: $($_.exception.message)" -sev Error
}

catch {
Write-LogMessage -API 'Standards' -tenant $tenant -message "Could not set default calendar permissions for $($Mailbox.UserPrincipalName). Error: $($_.exception.message)" -sev Error
}

}
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Done setting default calendar permissions.' -sev Info

Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.8.1
4.8.2

0 comments on commit 2494cc2

Please sign in to comment.