Skip to content

Commit 8ffae09

Browse files
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev
2 parents 95de2b1 + ebae198 commit 8ffae09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-ListScheduledItems.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ Function Invoke-ListScheduledItems {
4949
}
5050

5151
$AllowedTenants = Test-CIPPAccess -Request $Request -TenantList
52+
5253
if ($AllowedTenants -notcontains 'AllTenants') {
53-
$Tasks = $Tasks | Where-Object -Property TenantId -In $AllowedTenants
54+
$TenantList = Get-Tenants -IncludeErrors | Select-Object customerId, defaultDomainName
55+
$AllowedTenantDomains = $TenantList | Where-Object -Property customerId -In $AllowedTenants | Select-Object -ExpandProperty defaultDomainName
56+
$Tasks = $Tasks | Where-Object -Property Tenant -In $AllowedTenantDomains
5457
}
5558
$ScheduledTasks = foreach ($Task in $tasks) {
5659
if ($Task.Parameters) {

0 commit comments

Comments
 (0)