Skip to content

Commit 8cda693

Browse files
authored
Merge pull request #235 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 8044ab8 + e1df19f commit 8cda693

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Tenant/Invoke-ListTenants.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-ListTenants {
3+
function Invoke-ListTenants {
44
<#
55
.FUNCTIONALITY
66
Entrypoint,AnyTenant
@@ -95,15 +95,15 @@ Function Invoke-ListTenants {
9595
}
9696
if ($Request.Query.Mode -eq 'TenantList') {
9797
# add portal link properties
98-
$Body = $Body | Select-Object *, @{Name = 'portal_m365'; Expression = { "https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=$($_.customerId)&CSDEST=o365admincenter" } },
99-
@{Name = 'portal_exchange'; Expression = { "https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=$($_.defaultDomainName)" } },
98+
$Body = $Body | Select-Object *, @{Name = 'portal_m365'; Expression = { "https://admin.cloud.microsoft/?delegatedOrg=$($_.initialDomainName)" } },
99+
@{Name = 'portal_exchange'; Expression = { "https://admin.cloud.microsoft/exchange/?delegatedOrg=$($_.initialDomainName)" } },
100100
@{Name = 'portal_entra'; Expression = { "https://entra.microsoft.com/$($_.defaultDomainName)" } },
101-
@{Name = 'portal_teams'; Expression = { "https://admin.teams.microsoft.com/?delegatedOrg=$($_.defaultDomainName)" } },
101+
@{Name = 'portal_teams'; Expression = { "https://admin.teams.microsoft.com/?delegatedOrg=$($_.initialDomainName)" } },
102102
@{Name = 'portal_azure'; Expression = { "https://portal.azure.com/$($_.defaultDomainName)" } },
103103
@{Name = 'portal_intune'; Expression = { "https://intune.microsoft.com/$($_.defaultDomainName)" } },
104104
@{Name = 'portal_security'; Expression = { "https://security.microsoft.com/?tid=$($_.customerId)" } },
105105
@{Name = 'portal_compliance'; Expression = { "https://purview.microsoft.com/?tid=$($_.customerId)" } },
106-
@{Name = 'portal_sharepoint'; Expression = { "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=$($_.customerId)&CSDEST=SharePoint" } }
106+
@{Name = 'portal_sharepoint'; Expression = { "/api/ListSharePointAdminUrl?tenantFilter=$($_.defaultDomainName)" } }
107107
}
108108

109109
} else {

Modules/CIPPCore/Public/Standards/Get-CIPPStandards.ps1

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ function Get-CIPPStandards {
2020
$Table = Get-CippTable -tablename 'templates'
2121
$Filter = "PartitionKey eq 'StandardsTemplateV2'"
2222
$Templates = (Get-CIPPAzDataTableEntity @Table -Filter $Filter | Sort-Object TimeStamp).JSON |
23-
ForEach-Object {
24-
try {
25-
# Fix old "Action" => "action"
26-
$JSON = $_ -replace '"Action":', '"action":' -replace '"permissionlevel":', '"permissionLevel":'
27-
ConvertFrom-Json -InputObject $JSON -ErrorAction SilentlyContinue
28-
} catch {}
29-
} |
30-
Where-Object {
31-
$_.GUID -like $TemplateId -and $_.runManually -eq $runManually
32-
}
23+
ForEach-Object {
24+
try {
25+
# Fix old "Action" => "action"
26+
$JSON = $_ -replace '"Action":', '"action":' -replace '"permissionlevel":', '"permissionLevel":'
27+
ConvertFrom-Json -InputObject $JSON -ErrorAction SilentlyContinue
28+
} catch {}
29+
} |
30+
Where-Object {
31+
$_.GUID -like $TemplateId -and $_.runManually -eq $runManually
32+
}
3333

3434
# 2. Get tenant list, filter if needed
3535
$AllTenantsList = Get-Tenants
@@ -138,7 +138,15 @@ function Get-CIPPStandards {
138138

139139
if ($template.excludedTenants) {
140140
if ($template.excludedTenants -is [System.Collections.IEnumerable] -and -not ($template.excludedTenants -is [string])) {
141-
$excludedTenantValues = $template.excludedTenants | ForEach-Object { $_.value }
141+
$excludedTenantValues = $template.excludedTenants | ForEach-Object {
142+
$FilterValue = $_.value
143+
if ($_.type -eq 'Group') {
144+
($TenantGroups | Where-Object {
145+
$_.Id -eq $FilterValue
146+
}).Members.defaultDomainName
147+
} else {
148+
$FilterValue
149+
} }
142150
} else {
143151
$excludedTenantValues = @($template.excludedTenants)
144152
}

Modules/CippExtensions/Public/Hudu/Get-HuduFieldMapping.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Get-HuduFieldMapping {
6868
CIPPFields = $CIPPFields
6969
CIPPFieldHeaders = $CIPPFieldHeaders
7070
IntegrationFields = @($Unset) + @($AssetLayouts)
71-
Mappings = $Mappings
71+
Mappings = @($Mappings)
7272
}
7373

7474
return $MappingObj

Modules/CippExtensions/Public/NinjaOne/Get-NinjaOneFieldMapping.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function Get-NinjaOneFieldMapping {
109109
CIPPFields = $CIPPFields
110110
CIPPFieldHeaders = $CIPPFieldHeaders
111111
IntegrationFields = @($Unset) + @($NinjaCustomFieldsOrg) + @($NinjaCustomFieldsNode)
112-
Mappings = $Mappings
112+
Mappings = @($Mappings)
113113
}
114114

115115
return $MappingObj

0 commit comments

Comments
 (0)