Windows Server
SCEPmanClient
API Enrollment
Use Case Description
$Subject = $env:COMPUTERNAME
$ValidityThreshold = 30
$CertificateToRenew = Get-ChildItem Cert:\LocalMachine\My `
| Where-Object NotAfter -lt (Get-Date).AddDays($ValidityThreshold) `
| Where-Object Subject -match $Subject
New-SCEPmanCertificate -Certificate $CertificateToRenew -SaveToStore 'LocalMachine'
# With the new certificate in place we can remove the old one
# Remove-Item $CertificateToRenew.PSPathInitial Request
API EnrollmentLast updated
Was this helpful?