Last active
March 23, 2023 22:57
-
-
Save mawiseman/f6db3c629b67bd4475bf406bc5145d81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module WebAdministration | |
$results = Get-ChildItem "IIS:\SslBindings\" | ForEach-Object { | |
$store = $_.Store | |
$thumbprint = $_.Thumbprint | |
$cert = Get-ChildItem -Path Cert:\LocalMachine\$store | Where-Object { $_.Thumbprint -eq $thumbprint } | |
[PSCustomObject]@{ | |
Host = $_.Host; | |
Subject = $cert.Subject; | |
NotAfter = $cert.NotAfter; | |
Thumbprint = $cert.Thumbprint | |
} | |
} | |
# Write to console | |
$results | Format-Table -AutoSize | |
# Save to file | |
$results | Export-Csv -Path "c:\temp\iis-bindings.csv" -NoTypeInformation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment