Skip to content

Commit 81257a5

Browse files
authored
Merge pull request #520 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 4c7ac33 + b783c3d commit 81257a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ function Get-Tenants {
9494
throw 'RefreshToken not set. Cannot get tenant list.'
9595
}
9696
#get the full list of tenants
97-
$GDAPRelationships = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships?`$filter=status eq 'active' and not startsWith(displayName,'MLT_')$RelationshipFilter&`$select=customer,autoExtendDuration,endDateTime&`$top=300" -NoAuthCheck:$true
97+
$GDAPRelationships = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships?`$filter=status eq 'active' and not startsWith(displayName,'MLT_')$RelationshipFilter&`$select=customer,autoExtendDuration,endDateTime" -NoAuthCheck:$true
98+
Write-Host "GDAP relationships found: $($GDAPRelationships.Count)"
99+
Write-Information "GDAP relationships found: $($GDAPRelationships.Count)"
100+
$totalTenants = $GDAPRelationships.customer.tenantId.Count | Select-Object -Unique
101+
Write-Information "Total tenants found in relationships result: $totalTenants"
98102
$GDAPList = foreach ($Relationship in $GDAPRelationships) {
99103
[PSCustomObject]@{
100104
customerId = $Relationship.customer.tenantId

0 commit comments

Comments
 (0)