PowerShell Module
This module allows management of the certdog application from the command line, or can be integrated with your own scripts
Running from the Command Line
Open a PowerShell window as Administrator
Navigate to [certdog install]\bin
e.g. c:\certdog\bin
Import the module:
Import-Module .\certdog-module.psm1
To view the available commands run:
Get-Command -Module certdog-module
Login with:
login -username [username] -password [password]
Or just type login
to be prompted
Examples
Show available Certificate Issuers
Get-Cas
or
Get-Cas | Format-Table
Show available CSR Generators
Get-CsrGenerators
Request a certificate from a CSR (provided as a file)
Request-CertP10 -caName "Microsoft TLS" -csrFilename C:\Downloads\server22.certdog.local.csr
Where caName is the issuer name as configured within Certdog. This is the name that will be displayed when the cas
command is run (above)
Request a certificate from a CSR (provided as data within a variable)
# Read the CSR data
$csrData = Get-Content C:\Downloads\server22.certdog.local.csr
# Send to Certdog
Request-CertP10 -caName "Microsoft TLS" -csr $csrData
Request a certificate with Certdog creating the CSR
$cert = Request-Cert -dn "CN=PowerShell Test,C=GB" -caName "Microsoft TLS" -csrGeneratorName "RSA 2048 Generator" -p12Password "password"
Then save as a PFX
Set-Content -Path C:\Downloads\powershell.pfx -Value $cert.p12Data
Search for certificates
Search based on expiry dates:
$certs = search -validToFrom "2026-05-02T11:00" -validToTo "2026-05-02T13:00"
Search based on issued dates:
$certs = search -validFromFrom "2026-05-02T11:00" -validFromTo "2026-05-10T13:00"
Search for all certificates that have “test” including in their DN:
$certs = search -subjectDn "test"
Search for all certificates issued by CN=Certdog Test Issuing CA, O=Krestfield
$certs = search -issuerDn "CN=Certdog Test Issuing CA, O=Krestfield"
Find all active certificates:
$certs = search -status "active"
Find all active certificates, issued in the last 30 days:
$now = Get-Date
$nowStr = $now.ToString("yyyy-MM-ddTHH:mm")
$30daysAgoStr = $now.AddDays(-30).ToString("yyyy-MM-ddTHH:mm")
$certs = search -validFromFrom $30daysAgoStr -validFromTo $nowStr -status "active"