Skip to content

Commit abfeee8

Browse files
committed
more tweaks
1 parent ad2d8e1 commit abfeee8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function Get-Tenants {
7575
if (($BuildRequired -or $TriggerRefresh.IsPresent) -and $PartnerTenantState.state -ne 'owntenant') {
7676
# Get TenantProperties table
7777
$PropertiesTable = Get-CippTable -TableName 'TenantProperties'
78-
$Aliases = Get-CIPPAzDataTableEntity @PropertiesTable -Filter "RowKey eq 'Alias'"
7978

8079
#get the full list of tenants
8180
$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
@@ -95,7 +94,7 @@ function Get-Tenants {
9594
# Write-Host "Processing $($_.Name), $($_.displayName) to add to tenant list."
9695
$ExistingTenantInfo = Get-CIPPAzDataTableEntity @TenantsTable -Filter "PartitionKey eq 'Tenants' and RowKey eq '$($_.Name)'"
9796

98-
$Alias = ($Aliases | Where-Object { $_.PartitionKey -eq $_.Name }).Value
97+
$Alias = (Get-AzDataTableEntity @PropertiesTable -Filter "PartitionKey eq '$($_.Name)' and RowKey eq 'Alias'").Value
9998

10099
if ($TriggerRefresh.IsPresent -and $ExistingTenantInfo.customerId) {
101100
# Reset error count
@@ -116,7 +115,7 @@ function Get-Tenants {
116115
}
117116
} else {
118117
if ($LatestRelationship.displayName -ne $ExistingTenantInfo.displayName) {
119-
Write-Host "Display name changed from relationship, updating."
118+
Write-Host 'Display name changed from relationship, updating.'
120119
$ExistingTenantInfo.displayName = $LatestRelationship.displayName
121120
$DisplayNameUpdated = $true
122121
}

0 commit comments

Comments
 (0)