Skip to content

Instantly share code, notes, and snippets.

View gareththered's full-sized avatar

Gareth Williams gareththered

View GitHub Profile
@gareththered
gareththered / requestid.ps1
Last active August 2, 2022 07:27
Display the CA's RequestID after generating a request with Get-Certificate
$req = Get-Certificate -Url ldap: -Template ExampleWebServer -SubjectName "CN=Test" -DnsName "test.example.com" -CertStoreLocation Cert:\LocalMachine\My\
$hexSKI=$req.Request.Extensions.SubjectKeyIdentifier
# Interrogate CA for request with the above SKI:
# Get CA connection string:
$CC_DEFAULTCONFIG = 0
$CaConfig = $(New-Object -ComObject CertificateAuthority.Config).GetConfig($CC_DEFAULTCONFIG)