Skip to content

Commit cf2536d

Browse files
committed
fix tenant cleanup
1 parent 42bdfb2 commit cf2536d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/CIPPCore/Public/GraphHelper/Get-Tenants.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function Get-Tenants {
6767
relationshipEnd = $Relationship.endDateTime
6868
}
6969
}
70-
$CurrentTenants = Get-CIPPAzDataTableEntity @TenantsTable -Filter "PartitionKey eq 'Tenants' and Excluded eq false"
70+
$CurrentTenants = Get-CIPPAzDataTableEntity @TenantsTable -Filter "PartitionKey eq 'Tenants' and Excluded eq false and delegatedPrivilegeStatus ne 'directTenant'"
7171
$CurrentTenants | Where-Object { $_.customerId -notin $GDAPList.customerId -and $_.customerId -ne $env:TenantID } | ForEach-Object {
7272
Remove-AzDataTableEntity -Force @TenantsTable -Entity $_
7373
}

0 commit comments

Comments
 (0)