Skip to content

Commit

Permalink
Merge pull request #646 from HenrikPiecha/fix-duplicate-check-of-mfam…
Browse files Browse the repository at this point in the history
…igration

Fix duplicate check of mfamigration
  • Loading branch information
merill authored Feb 14, 2025
2 parents e549bdb + fc845d4 commit ce1481b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions powershell/public/cisa/entra/Test-MtCisaWeakFactor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ function Test-MtCisaWeakFactor {
"Email"
)

$isMethodsMigrationComplete = Test-MtCisaMethodsMigration

$result = Get-MtAuthenticationMethodPolicyConfig

$weakAuthMethods = $result | Where-Object { $_.id -in $weakFactors }

$enabledWeakMethods = $weakAuthMethods | Where-Object { $_.state -eq "enabled" }

$testResult = (($enabledWeakMethods|Measure-Object).Count -eq 0) -and $isMethodsMigrationComplete
$testResult = (($enabledWeakMethods|Measure-Object).Count -eq 0)

if ($testResult) {
$testResultMarkdown = "Well done. All weak authentication methods are disabled in your tenant.`n`n%TestResult%"
Expand All @@ -53,10 +51,8 @@ function Test-MtCisaWeakFactor {

# Auth method does not support deep links.
$authMethodsLink = "https://entra.microsoft.com/#view/Microsoft_AAD_IAM/AuthenticationMethodsMenuBlade/~/AdminAuthMethods"
$migrationResult = "❌ Fail"
if($isMethodsMigrationComplete){$migrationResult = "✅ Pass"}
$result = "[Authentication Methods]($authMethodsLink) Migration Complete: $migrationResult`n`n"
$result += "| Authentication Method | State | Test Result |`n"

$result = "| Authentication Method | State | Test Result |`n"
$result += "| --- | --- | --- |`n"
foreach ($item in $weakAuthMethods) {
$methodResult = "✅ Pass"
Expand Down

0 comments on commit ce1481b

Please sign in to comment.