From 3bc50dad6f27d58bb5671afd0d4e073b7393ef31 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Mon, 20 Nov 2023 23:36:27 +0100 Subject: [PATCH 1/2] Fixes scheduled offboarding bug. --- Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1 b/Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1 index 6fb164fe356c..4232a71adaf4 100644 --- a/Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1 +++ b/Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1 @@ -68,7 +68,8 @@ function Invoke-CIPPOffboardingJob { } { $_."RemovePermissions" } { if ($RunScheduled) { - Remove-CIPPMailboxPermissions #Finish this + Remove-CIPPMailboxPermissions -PermissionsLevel @("FullAccess", "SendAs", "SendOnBehalf") -userid "AllUsers" -AccessUser $UserName -TenantFilter $TenantFilter -APIName $APINAME -ExecutingUser $ExecutingUser + } else { $object = [PSCustomObject]@{ From d057aad260dd0a7882b3171de2e96835391c04eb Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Mon, 20 Nov 2023 23:46:12 +0100 Subject: [PATCH 2/2] fixes removal bug --- Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1 | 4 ++++ version_latest.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1 b/Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1 index b11a1bfbe7d9..c9e480445056 100644 --- a/Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1 +++ b/Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1 @@ -13,6 +13,10 @@ function Remove-CIPPMailboxPermissions { if ($userid -eq "AllUsers") { $Mailboxes = New-ExoRequest -tenantid $TenantFilter -cmdlet "get-mailbox" $Mailboxes | ForEach-Object -Parallel { + Import-Module ".\Modules\CIPPCore" + import-module ".\GraphHelper.psm1" + Import-Module ".\Modules\AzBobbyTables" + Write-Host "Removing permissions from mailbox $($_.UserPrincipalName)" Remove-CIPPMailboxPermissions -PermissionsLevel @("FullAccess", "SendAs", "SendOnBehalf") -userid $_.UserPrincipalName -AccessUser $using:AccessUser -TenantFilter $using:TenantFilter -APIName $using:APINAME -ExecutingUser $using:ExecutingUser } -ThrottleLimit 10 } diff --git a/version_latest.txt b/version_latest.txt index 28446a5ea556..f4fa8fcb995d 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -4.6.0 \ No newline at end of file +4.6.1 \ No newline at end of file