Skip to content

Commit 02a318b

Browse files
committed
fix cpv refresh for direct tenant
1 parent b2972fc commit 02a318b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/CIPPCore/Public/Set-CIPPCPVConsent.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ function Set-CIPPCPVConsent {
1717
if ($Tenant.customerId -ne $TenantFilter) {
1818
return @('Not a valid tenant')
1919
}
20+
if ($Tenant.delegatedPrivilegeStatus -eq 'directTenant') {
21+
return @('Application is already consented to this tenant')
22+
}
2023

2124
if ($ResetSP) {
2225
try {
@@ -40,7 +43,7 @@ function Set-CIPPCPVConsent {
4043
'DelegatedPermissionGrant.ReadWrite.All',
4144
'Directory.ReadWrite.All',
4245
'AppRoleAssignment.ReadWrite.All'
43-
) -Join ','
46+
) -join ','
4447
}
4548
)
4649
} | ConvertTo-Json

0 commit comments

Comments
 (0)