File tree Expand file tree Collapse file tree
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Tenant Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,16 @@ function Invoke-ListTenants {
7070 }
7171 try {
7272 $TenantFilter = $Request.Query.tenantFilter
73- $Tenants = Get-Tenants - IncludeErrors - SkipDomains
73+ $tenantParams = @ {
74+ IncludeErrors = $true
75+ SkipDomains = $true
76+ }
77+ if ($TenantFilter -and $TenantFilter -ne ' AllTenants' ) {
78+ $tenantParams [' TenantFilter' ] = $TenantFilter
79+ }
80+
81+ $Tenants = Get-Tenants @tenantParams
82+
7483 if ($TenantAccess -notcontains ' AllTenants' ) {
7584 $Tenants = $Tenants | Where-Object - Property customerId -In $TenantAccess
7685 }
@@ -98,7 +107,7 @@ function Invoke-ListTenants {
98107 }
99108 }
100109
101- if ($null -eq $TenantFilter -or $TenantFilter -eq ' null' ) {
110+ if (( $null -eq $TenantFilter -or $TenantFilter -eq ' null' ) -or $Request .Query.Mode -eq ' TenantList ' ) {
102111 $TenantList = [system.collections.generic.list [object ]]::new()
103112 if ($AllTenantSelector -eq $true ) {
104113 $AllTenantsObject = @ {
@@ -141,7 +150,7 @@ function Invoke-ListTenants {
141150 }
142151
143152 } else {
144- $body = $Tenants | Where-Object - Property defaultDomainName -EQ $TenantFilter
153+ $body = $Tenants
145154 }
146155
147156 Write-LogMessage - headers $Headers - tenant $TenantFilter - API $APIName - message ' Listed Tenant Details' - Sev ' Debug'
You can’t perform that action at this time.
0 commit comments