Skip to content

Commit 0273f1b

Browse files
committed
Synchronized with SCOM-Scripts-and-SQL 🎆 🌟
1 parent f2211d8 commit 0273f1b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Powershell/Start-SCOMCertificateChecker.ps1 renamed to Powershell/Test-SCOMCertificate.ps1

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
Where to Output the File (txt, log, etc) for Script Execution.
2121
.EXAMPLE
2222
Check All Certificates on 4 Servers and outputting the results to C:\Temp\Output.txt:
23-
PS C:\> .\Invoke-CheckSCOMCertificates.ps1 -Servers ManagementServer1, ManagementServer2.contoso.com, Gateway.contoso.com, Agent1.contoso.com -All -OutputFile C:\Temp\Output.txt
23+
PS C:\> .\Test-SCOMCertificate.ps1 -Servers ManagementServer1, ManagementServer2.contoso.com, Gateway.contoso.com, Agent1.contoso.com -All -OutputFile C:\Temp\Output.txt
2424
.EXAMPLE
2525
Check for a specific Certificate serialnumber in the Local Machine Personal Certificate store:
26-
PS C:\> .\Invoke-CheckSCOMCertificates.ps1 -SerialNumber 1f00000008c694dac94bcfdc4a000000000008
26+
PS C:\> .\Test-SCOMCertificate.ps1 -SerialNumber 1f00000008c694dac94bcfdc4a000000000008
2727
.EXAMPLE
2828
Check all certificates on the local machine:
29-
PS C:\> .\Invoke-CheckSCOMCertificates.ps1 -All
29+
PS C:\> .\Test-SCOMCertificate.ps1 -All
3030
.NOTES
31+
Update 03/2024 (Blake Drumm, https://blakedrumm.com/)
32+
Changed the name from Start-SCOMCertificateChecker to Test-SCOMCertificate.
3133
Update 05/2023 (Blake Drumm, https://blakedrumm.com/)
3234
Added ability to check certificates missing a common name.
3335
Update 02/2023 (Blake Drumm, https://github.com/blakedrumm/)
@@ -64,8 +66,8 @@
6466
Modification for CA chain validation
6567
Adds needed check for MachineKeyStore property on the private key
6668
Original Publish Date 1/2009 (Lincoln Atkinson?, https://blogs.technet.microsoft.com/momteam/author/latkin/)
67-
68-
#>[CmdletBinding()]
69+
#>
70+
[CmdletBinding()]
6971
[OutputType([string])]
7072
param
7173
(
@@ -679,7 +681,7 @@ $(Invoke-TimeStamp) : Script Completed
679681
PROCESS
680682
{
681683
#region Function
682-
function Invoke-CheckSCOMCertificate
684+
function Test-SCOMCertificate
683685
{
684686
[OutputType([string])]
685687
[CmdletBinding()]
@@ -756,18 +758,18 @@ Certificate Checker
756758
#region DefaultActions
757759
if ($Servers -or $OutputFile -or $All -or $SerialNumber)
758760
{
759-
Invoke-CheckSCOMCertificate -Servers $Servers -OutputFile $OutputFile -All:$All -SerialNumber:$SerialNumber
761+
Test-SCOMCertificate -Servers $Servers -OutputFile $OutputFile -All:$All -SerialNumber:$SerialNumber
760762
}
761763
else
762764
{
763-
# Modify line 770 if you want to change the default behavior when running this script through Powershell ISE
765+
# Modify line 772 if you want to change the default behavior when running this script through Powershell ISE
764766
#
765767
# Examples:
766-
# Invoke-CheckSCOMCertificate -SerialNumber 1f00000008c694dac94bcfdc4a000000000008
767-
# Invoke-CheckSCOMCertificate -All
768-
# Invoke-CheckSCOMCertificate -All -OutputFile C:\Temp\Certs-Output.txt
769-
# Invoke-CheckSCOMCertificate -Servers MS01, MS02
770-
Invoke-CheckSCOMCertificate
768+
# Test-SCOMCertificate -SerialNumber 1f00000008c694dac94bcfdc4a000000000008
769+
# Test-SCOMCertificate -All
770+
# Test-SCOMCertificate -All -OutputFile C:\Temp\Certs-Output.txt
771+
# Test-SCOMCertificate -Servers MS01, MS02
772+
Test-SCOMCertificate
771773
}
772774
#endregion DefaultActions
773775
}

0 commit comments

Comments
 (0)