File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Modules/CIPPCore/Public/Entrypoints/Activity Triggers Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,20 @@ function Push-ListMailboxRulesQueue {
1212
1313 $Table = Get-CIPPTable - TableName cachembxrules
1414 try {
15- $Rules = New-ExoRequest - tenantid $domainName - cmdlet ' Get-Mailbox' - Select ' userPrincipalName,GUID' | ForEach-Object - Parallel {
16- Import-Module CIPPCore
17- $MbxRules = New-ExoRequest - Anchor $_.UserPrincipalName - tenantid $using :domainName - cmdlet ' Get-InboxRule' - cmdParams @ {Mailbox = $_.GUID ; IncludeHidden = $true } | Where-Object { $_.Name -ne ' Junk E-Mail Rule' -and $_.Name -notlike ' Microsoft.Exchange.OOF.*' }
18- foreach ($Rule in $MbxRules ) {
19- $Rule | Add-Member - NotePropertyName ' UserPrincipalName' - NotePropertyValue $_.userPrincipalName
20- $Rule
15+ $Mailboxes = New-ExoRequest - tenantid $domainName - cmdlet ' Get-Mailbox' - Select ' userPrincipalName,GUID'
16+ $Request = $Mailboxes | ForEach-Object {
17+ @ {
18+ OperationGuid = $_.UserPrincipalName
19+ CmdletInput = @ {
20+ CmdletName = ' Get-InboxRule'
21+ Parameters = @ {
22+ Mailbox = $_.UserPrincipalName
23+ }
24+ }
2125 }
2226 }
27+
28+ $Rules = New-ExoBulkRequest - tenantid $domainName - cmdletArray @ ($Request ) | Where-Object { $_.Identity }
2329 if (($Rules | Measure-Object ).Count -gt 0 ) {
2430 $GraphRequest = foreach ($Rule in $Rules ) {
2531 [PSCustomObject ]@ {
You can’t perform that action at this time.
0 commit comments