Skip to content

Commit

Permalink
Merge pull request #241 from styx-tdo/main
Browse files Browse the repository at this point in the history
Fix variable name certfileMY
  • Loading branch information
wh1te909 authored Jul 25, 2024
2 parents 6e314ce + c97842f commit 116e51d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/Win_IIS_Check_SSL_Certs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
.INSTRUCTIONS
Add this as a script check to your Windows Server that has IIS installed.
.NOTES
Version: 1.0
Version: 1.1
Author: ebdavison (nalantha on discord)
Creation Date: 2022-08-08
Updated: 2024-07-25 styx-tdo
#>

param
Expand Down Expand Up @@ -60,13 +61,21 @@ $CertState = foreach ($bind in $bindingslist) {

if ($certFileWH.NotAfter) {
if ($certFileWH.NotAfter -lt $Days) {
"$($bindsite) = $($certfileWH.FriendlyName) / $($certfileWH.thumbprint) will expire on $($certfileWH.NotAfter)"
if (certfileWH.FriendlyName) {
"$($bindsite) = $($certfileWH.FriendlyName) / $($certfileWH.thumbprint) will expire on $($certfileWH.NotAfter)"
}else{
"$($bindsite) = $($certfileWH.Subject) / $($certfileWH.thumbprint) will expire on $($certfileWH.NotAfter)"
}
}
}

if ($certFileMY.NotAfter) {
if ($certFileMY.NotAfter -lt $Days) {
"$($bindsite) = $($certfileMY.FriendlyName) / $($certfileMY.thumbprint) will expire on $($certfileWMY.NotAfter)"
if (certfileMY.FriendlyName) {
"$($bindsite) = $($certfileMY.FriendlyName) / $($certfileMY.thumbprint) will expire on $($certfileMY.NotAfter)"
}else{
"$($bindsite) = $($certfileMY.Subject) / $($certfileMY.thumbprint) will expire on $($certfileMY.NotAfter)"
}
}
}
}
Expand All @@ -78,4 +87,4 @@ if (!$certState){
} else {
Write-Output $CertState
exit 1
}
}

0 comments on commit 116e51d

Please sign in to comment.