From ac9bc298005ce7826ff71404dfd3933f14b9a3ec Mon Sep 17 00:00:00 2001 From: Thomas Naunheim Date: Mon, 17 Feb 2025 07:33:00 +0100 Subject: [PATCH] Added Entra ID Free tenant license checks --- powershell/internal/eidsca/Test-MtEidscaPR05.ps1 | 5 ++++- powershell/internal/eidsca/Test-MtEidscaPR06.ps1 | 5 ++++- tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 b/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 index 2013c581..ea71b5db 100644 --- a/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 @@ -21,7 +21,10 @@ function Test-MtEidscaPR05 { [OutputType([bool])] param() - + if ( $EntraIDPlan -eq 'Free' ) { + Add-MtTestResultDetail -SkippedBecause 'Custom' -SkippedCustomReason '' + return $null + } $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [int]$tenantValue = $result.values | where-object name -eq 'LockoutDurationInSeconds' | select-object -expand value diff --git a/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 b/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 index 3fdec368..144c661e 100644 --- a/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 @@ -21,7 +21,10 @@ function Test-MtEidscaPR06 { [OutputType([bool])] param() - + if ( $EntraIDPlan -eq 'Free' ) { + Add-MtTestResultDetail -SkippedBecause 'Custom' -SkippedCustomReason 'This test is for tenants that are licensed for Entra ID P1 or higher. See [Entra ID licensing](https://learn.microsoft.com/entra/fundamentals/licensing)' + return $null + } $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [int]$tenantValue = $result.values | where-object name -eq 'LockoutThreshold' | select-object -expand value diff --git a/tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 b/tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 index 732b8581..70fbb4f2 100644 --- a/tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 +++ b/tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 @@ -143,7 +143,7 @@ Describe "Default Settings - Password Rule Settings" -Tag "EIDSCA", "Security", } } Describe "Default Settings - Password Rule Settings" -Tag "EIDSCA", "Security", "All", "EIDSCA.PR05" { - It "EIDSCA.PR05: Default Settings - Password Rule Settings - Smart Lockout - Lockout duration in seconds. See https://maester.dev/docs/tests/EIDSCA.PR05" { + It "EIDSCA.PR05: Default Settings - Password Rule Settings - Smart Lockout - Lockout duration in seconds. See https://maester.dev/docs/tests/EIDSCA.PR05" -TestCases @{ EntraIDPlan = $EntraIDPlan } { <# Check if "https://graph.microsoft.com/beta/settings" .values | where-object name -eq 'LockoutDurationInSeconds' | select-object -expand value -ge '60' @@ -152,7 +152,7 @@ Describe "Default Settings - Password Rule Settings" -Tag "EIDSCA", "Security", } } Describe "Default Settings - Password Rule Settings" -Tag "EIDSCA", "Security", "All", "EIDSCA.PR06" { - It "EIDSCA.PR06: Default Settings - Password Rule Settings - Smart Lockout - Lockout threshold. See https://maester.dev/docs/tests/EIDSCA.PR06" { + It "EIDSCA.PR06: Default Settings - Password Rule Settings - Smart Lockout - Lockout threshold. See https://maester.dev/docs/tests/EIDSCA.PR06" -TestCases @{ EntraIDPlan = $EntraIDPlan } { <# Check if "https://graph.microsoft.com/beta/settings" .values | where-object name -eq 'LockoutThreshold' | select-object -expand value -eq '10'