Using PowerShell to request a new certificate
So far, we've seen that most of the work we've done with the CA service has been done through GUIs with lots of clicking. This is fine for one-off tasks, and we're about to see how to automatically enroll entire batches of computers with certificates. But what about the middle ground – where you want to issue certificates to some computers, perhaps as part of an automated script?
Well, have no fear – PowerShell has all the tools we need to do the exact same work from Windows servers.
Getting ready
We're going to request a certificate from a Windows Server 2019 web server from our CA that we set up earlier for issuing web certificates. In this example, I'm issuing a custom template called WebECDH
, but you could issue from any of your existing certificate templates.
How to do it…
In this recipe, we're going to request a certificate with a custom hostname. This is so we can...