Skip to content

Commit a6d04cd

Browse files
authored
Merge pull request #521 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 81257a5 + d4830f6 commit a6d04cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +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" -NoAuthCheck:$true
97+
$GDAPRelationships = New-GraphGetRequest -uri "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships?`$filter=status eq 'active' and not startsWith(displayName,'MLT_')$RelationshipFilter&`$select=customer,autoExtendDuration,endDateTime" -NoAuthCheck:$true
9898
Write-Host "GDAP relationships found: $($GDAPRelationships.Count)"
9999
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"
100+
$totalTenants = $GDAPRelationships.customer.tenantId | Select-Object -Unique
101+
Write-Information "Total tenants found in relationships result: $($totalTenants.count)"
102102
$GDAPList = foreach ($Relationship in $GDAPRelationships) {
103103
[PSCustomObject]@{
104104
customerId = $Relationship.customer.tenantId

0 commit comments

Comments
 (0)