File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Modules/CIPPCore/Public/Alerts Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,13 @@ function Get-CIPPAlertNoCAConfig {
1212 )
1313
1414 try {
15- $CAAvailable = (New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/subscribedSkus' - tenantid $TenantFilter - ErrorAction Stop).serviceplans
16- if (' AAD_PREMIUM' -in $CAAvailable.servicePlanName ) {
15+ # Only consider CA available when a SKU that grants it has enabled seats (> 0)
16+ $SubscribedSkus = New-GraphGetRequest - uri " https://graph.microsoft.com/beta/subscribedSkus?`$ select=prepaidUnits,servicePlans" - tenantid $TenantFilter - ErrorAction Stop
17+ $CAAvailable = foreach ($sku in $SubscribedSkus ) {
18+ if ([int ]$sku.prepaidUnits.enabled -gt 0 ) { $sku.servicePlans }
19+ }
20+
21+ if ((' AAD_PREMIUM' -in $CAAvailable.servicePlanName ) -or (' AAD_PREMIUM_P2' -in $CAAvailable.servicePlanName )) {
1722 $CAPolicies = (New-GraphGetRequest - uri ' https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies' - tenantid $TenantFilter )
1823 if (! $CAPolicies.id ) {
1924 $AlertData = ' Conditional Access is available, but no policies could be found.'
You can’t perform that action at this time.
0 commit comments