Skip to content

Commit 4d1e338

Browse files
committed
add initialDomainName to tenantfilter
1 parent d4bf4a6 commit 4d1e338

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function Get-Tenants {
4242
$IncludedTenantFilter = [scriptblock]::Create("`$_.customerId -eq '$TenantFilter'")
4343
$RelationshipFilter = " and customer/tenantId eq '$TenantFilter'"
4444
} else {
45-
$Filter = "{0} and defaultDomainName eq '{1}'" -f $Filter, $TenantFilter
46-
$IncludedTenantFilter = [scriptblock]::Create("`$_.defaultDomainName -eq '$TenantFilter'")
45+
$Filter = "{0} and defaultDomainName eq '{1}' -or initialDomainName eq '{1}'" -f $Filter, $TenantFilter
46+
$IncludedTenantFilter = [scriptblock]::Create("`$_.defaultDomainName -eq '$TenantFilter' -or `$_.initialDomainName -eq '$TenantFilter'")
4747
$RelationshipFilter = ''
4848
}
4949
} else {

0 commit comments

Comments
 (0)