Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending template supersedence not possible. #17

Closed
Geo-Ron opened this issue Feb 14, 2024 · 1 comment · Fixed by #18
Closed

Appending template supersedence not possible. #17

Geo-Ron opened this issue Feb 14, 2024 · 1 comment · Fixed by #18

Comments

@Geo-Ron
Copy link
Contributor

Geo-Ron commented Feb 14, 2024

the property msPKI-Supersede-Templates is not set in the New-ADCSTemplate command.

I will try to implement this and create a merge request

@Geo-Ron
Copy link
Contributor Author

Geo-Ron commented Feb 14, 2024

Live Action example:

Import-Module ADCSTemplate # Do not use the powershell gallery version of this module. Use the included one
Import-Module PSPKI

$entCA = Connect-CertificationAuthority
$originOCSPTemplate = Get-CertificateTemplate | Where-Object DisplayName -eq 'OCSP Response Signing'
$templateJSON = Export-ADCSTemplate -DisplayName $originOCSPTemplate.DisplayName
$templateObject = $templateJSON | ConvertFrom-JSON
$templateObject.name = 'OCSPResponseSigningv1.0'
$templateObject.DisplayName = 'OCSP Response Signing v1.0'
$templateObject.flags = 131648
$templateObject.'msPKI-Enrollment-Flag' = 20512
$templateObject.'msPKI-Private-Key-Flag' = 101056512
$templateObject.'msPKI-Template-Schema-Version' = 4
$templateObject.'msPKI-Template-Minor-Revision' = $templateObject.'msPKI-Template-Minor-Revision' +1
$templateObject.'msPKI-Minimal-Key-Size' = 4096
$templateObject.'msPKI-RA-Application-Policies' = $templateObject.'msPKI-RA-Application-Policies' -replace 'SHA1','SHA256'
$templateObject | Add-Member -MemberType 'NoteProperty' -Name msPKI-Supersede-Templates -Value @(($templateJson | ConvertFrom-Json).Name)

New-ADCSTemplate -DisplayName $templateObject.DisplayName -JSON ($templateObject | ConvertTo-JSON) -Publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant