Skip to content

Commit 0ff5451

Browse files
committed
update cpv to support directTenant
1 parent e7cc8a0 commit 0ff5451

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function Push-UpdatePermissionsQueue {
1616
$Table = Get-CIPPTable -TableName cpvtenants
1717
$CPVRows = Get-CIPPAzDataTableEntity @Table | Where-Object -Property Tenant -EQ $Item.customerId
1818

19-
if (!$CPVRows -or $env:ApplicationID -notin $CPVRows.applicationId) {
19+
$Tenant = Get-Tenants -TenantFilter $Item.customerId -IncludeErrors
20+
21+
if ((!$CPVRows -or $env:ApplicationID -notin $CPVRows.applicationId) -and $Tenant.delegatedPrivilegeStatus -ne 'directTenant') {
2022
Write-LogMessage -tenant $Item.defaultDomainName -tenantId $Item.customerId -message 'A New tenant has been added, or a new CIPP-SAM Application is in use' -Sev 'Warn' -API 'NewTenant'
2123
Write-Information 'Adding CPV permissions'
2224
Set-CIPPCPVConsent -Tenantfilter $Item.customerId

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-UpdatePermissionsOrchestrator.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Start-UpdatePermissionsOrchestrator {
1515
'displayName' = '*Partner Tenant'
1616
}
1717

18-
$TenantList = Get-Tenants -IncludeAll | Where-Object { $_.Excluded -eq $false -and $_.delegatedPrivilegeStatus -eq 'directTenant' }
18+
$TenantList = Get-Tenants -IncludeAll | Where-Object { $_.Excluded -eq $false }
1919

2020
$Tenants = [System.Collections.Generic.List[object]]::new()
2121
foreach ($Tenant in $TenantList) {

0 commit comments

Comments
 (0)