Skip to content

Commit 84acfde

Browse files
authored
Small update 🦅
1 parent 969d4ab commit 84acfde

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Powershell/Test-SCOMCertificate.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ $($ChainCertsOutput)
294294
# Not part of a domain
295295
continue;
296296
}
297+
297298
$subjectProblem = $false
298299
$fqdnRegexPattern = "CN=" + ($fqdn.Replace(".", "\.")).Replace(" ", "|CN=")
299300
try { $CheckForDuplicateSubjectCNs = ((($cert).Subject).Split(",") | %{ $_.Trim() } | Where { $_ -match "CN=" }).Trim("CN=") | % { $_.Split(".") | Select-Object -First 1 } | Group-Object | Where-Object { $_.Count -gt 1 } | Select -ExpandProperty Name }
@@ -597,11 +598,8 @@ Enhanced Key Usage Extension is Good
597598
else { $text42 = "Serial Number is written to the registry"; $out += "`n" + $text42; Write-Host $text42 -BackgroundColor Green -ForegroundColor Black }
598599
}
599600
}
600-
<#
601-
Check that the cert's issuing CA is trusted (This is not technically required
602-
as it is the remote machine cert's CA that must be trusted. Most users leverage
603-
the same CA for all machines, though, so it's worth checking
604-
#> $chain = new-object Security.Cryptography.X509Certificates.X509Chain
601+
#Check that the cert's issuing CA is trusted (This is not technically required as it is the remote machine cert's CA that must be trusted. Most users leverage the same CA for all machines, though, so it's worth checking
602+
$chain = new-object Security.Cryptography.X509Certificates.X509Chain
605603
$chain.ChainPolicy.RevocationMode = 0
606604
if ($chain.Build($cert) -eq $false)
607605
{
@@ -756,7 +754,7 @@ Certificate Checker
756754
continue
757755
}
758756
#endregion Function
759-
757+
760758
#region DefaultActions
761759
if ($Servers -or $OutputFile -or $All -or $SerialNumber)
762760
{

0 commit comments

Comments
 (0)