Skip to content

Commit 184ba88

Browse files
authored
Merge pull request #225 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 5bb499a + 80a1931 commit 184ba88

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecOnboardTenantQueue.ps1

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Function Push-ExecOnboardTenantQueue {
1+
function Push-ExecOnboardTenantQueue {
22
<#
33
.FUNCTIONALITY
44
Entrypoint
@@ -354,22 +354,29 @@ Function Push-ExecOnboardTenantQueue {
354354
if ($OnboardingSteps.Step4.Status -eq 'succeeded') {
355355
if ($Item.StandardsExcludeAllTenants -eq $true) {
356356
$AddExclusionObj = [PSCustomObject]@{
357-
label = $Tenant.defaultDomainName
357+
label = '{0} ({1})' -f $Tenant.displayName, $Tenant.defaultDomainName
358358
value = $Tenant.defaultDomainName
359-
addedFields = @{}
359+
addedFields = @{
360+
customerId = $Tenant.customerId
361+
defaultDomainName = $Tenant.defaultDomainName
362+
}
360363
}
361364
$Table = Get-CippTable -tablename 'templates'
362365
$ExistingTemplates = Get-CippazDataTableEntity @Table -Filter "PartitionKey eq 'StandardsTemplateV2'" | Where-Object { $_.JSON -match 'AllTenants' }
363-
foreach ($AllTenantesTemplate in $ExistingTemplates) {
366+
foreach ($AllTenantsTemplate in $ExistingTemplates) {
364367
$object = $AllTenantesTemplate.JSON | ConvertFrom-Json
365-
$NewExcludedTenants = $object.excludedTenants + $AddExclusionObj
368+
$NewExcludedTenants = [system.collections.generic.list[object]]::new()
369+
foreach ($Tenant in $object.excludedTenants) {
370+
$NewExcludedTenants.Add($Tenant)
371+
}
372+
$NewExcludedTenants.Add($AddExclusionObj)
366373
$object.excludedTenants = $NewExcludedTenants
367374
$JSON = ConvertTo-Json -InputObject $object -Compress -Depth 10
368375
$Table.Force = $true
369376
Add-CIPPAzDataTableEntity @Table -Entity @{
370377
JSON = "$JSON"
371-
RowKey = $AllTenantesTemplate.RowKey
372-
GUID = $AllTenantesTemplate.GUID
378+
RowKey = $AllTenantsTemplate.RowKey
379+
GUID = $AllTenantsTemplate.GUID
373380
PartitionKey = 'StandardsTemplateV2'
374381
}
375382
}

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecCippReplacemap.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function Invoke-ExecCippReplacemap {
33
.FUNCTIONALITY
44
Entrypoint
55
.ROLE
6-
CIPP.Extension.ReadWrite
6+
Tenant.Config.ReadWrite
77
#>
88
[CmdletBinding()]
99
param($Request, $TriggerMetadata)

0 commit comments

Comments
 (0)