Forum Discussion
You are correct the script does not show the missing data either:
Quote##--------------- Discovery ------------------##
$pshost = Get-Host # Get the PowerShell Host.
$pswindow = $pshost.UI.RawUI # Get the PowerShell Host's UI.$newsize = $pswindow.BufferSize # Get the UI's current Buffer Size.
$newsize.width = 800 # Set the new buffer's width to 800 columns.
$pswindow.buffersize = $newsize # Set the new Buffer Size as active.$newsize = $pswindow.windowsize # Get the UI's current Window Size.
$newsize.width = 800 # Set the new Window Width to 800 columns.
$pswindow.windowsize = $newsize # Set the new Window Size as active.$readOnly = [System.Security.Cryptography.X509Certificates.OpenFlags]"ReadOnly"
$localMachine = [System.Security.Cryptography.X509Certificates.StoreLocation]"LocalMachine"
$store = new-object System.Security.Cryptography.X509Certificates.X509Store( "\\##SYSTEM.SYSNAME##\my", $localMachine )$store.Open( $readOnly )
$store.Certificates `
| Select-Object { `
$_.Thumbprint + "##" `
+ $_.Issuer + "##" `
+ $_.Subject + $_.Issuer + $_.NotAfter + "##" `
+ "##" `
+ "cert.issuer=" + $_.Issuer `
+ "&cert.friendlyname=" + $_.FriendlyName `
+ "&cert.serialnumber=" + $_.SerialNumber `
+ "&cert.thumbprint=" + $_.Thumbprint `
+ "&cert.days=" + ($_.NotAfter - [datetime]::Today).Days `
+ "&cert.commonName=" + $_.Subject `
} `
| Format-Table -HideTableHeaders
The days is showing but why the big numbers like way other the 28 7 2 threholds!!!?
The commonname field does not show so this means it should not be the correct parameter... not sure if I should used the $_.Subject, SubjectAlternativeName (SAN) not sure which name it will have..., Issuedto, Issuedby, ...
Trying to find a list of names for all these parameters..
Thanks,
Dom
Related Content
- 3 months ago
- 3 years ago