Skip to content

Commit

Permalink
Merge pull request #1124 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
offboarding tweaks
  • Loading branch information
JohnDuprey authored Sep 26, 2024
2 parents 3dc6551 + 06fd5f6 commit c77d401
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ function Push-ExecOffboardingMailboxPermissions {
param(
$Item
)
$Mailboxes = New-ExoRequest -tenantid $Item.TenantFilter -cmdlet 'get-mailbox' -Select UserPrincipalName
foreach ($Mailbox in $Mailboxes) {
Remove-CIPPMailboxPermissions -PermissionsLevel @('FullAccess', 'SendAs', 'SendOnBehalf') -userid $Mailbox.UserPrincipalName -AccessUser $Item.User -TenantFilter $Item.TenantFilter -APIName $APINAME -ExecutingUser $Item.executingUser
}

Remove-CIPPMailboxPermissions -PermissionsLevel @('FullAccess', 'SendAs', 'SendOnBehalf') -userid 'AllUsers' -AccessUser $Item.User -TenantFilter $Item.TenantFilter -APIName $Item.APINAME -ExecutingUser $Item.ExecutingUser
}
3 changes: 2 additions & 1 deletion Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function Invoke-CIPPOffboardingJob {
'FunctionName' = 'ExecOffboardingMailboxPermissions'
'TenantFilter' = $TenantFilter
'User' = $Username
'executingUser' = $ExecutingUser
'ExecutingUser' = $ExecutingUser
'APINAME' = $APINAME
'QueueId' = $Queue.RowKey
}
)
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Remove-CIPPMailboxPermissions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Remove-CIPPMailboxPermissions {

try {
if ($userid -eq 'AllUsers') {
$Mailboxes = New-ExoRequest -tenantid $TenantFilter -cmdlet 'get-mailbox'
$Mailboxes = New-ExoRequest -tenantid $TenantFilter -cmdlet 'Get-Mailbox' -Property UserPrincipalName
$Mailboxes | ForEach-Object -Parallel {
Import-Module '.\Modules\AzBobbyTables'
Import-Module '.\Modules\CIPPCore'
Expand Down

0 comments on commit c77d401

Please sign in to comment.