Skip to content

Commit b205ec1

Browse files
authored
Merge pull request #419 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 9e89325 + e9fd45d commit b205ec1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertNoCAConfig.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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.'

version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.0
1+
8.3.1

0 commit comments

Comments
 (0)