Active Directory with a trusted certificate
In this tutorial I will show you how to install Active Directory with a certificate from a trusted certificate authority (CA). I got this experience from deployment of a Windows domain in the Silicon Hill student’s club.
Prerequisities
We need to have a certificate and a corresponding private key in the .pfx or .p12 format. If you have it in the classic .pem format, here’s a tutorial how to convert it.
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
Note: No Active Directory Certificate Services needed as some tutorials may suggest.
Versions
Versions are always important to every tutorial, since what works on one version, may not work on others.
We will be using Windows Server 2012.
Overview of the steps
- Add the Active Directory Domain Services role to the server.
- Import the certificate with private key (*.pfx or *.p12) to the correct certificate store.
- Promote the server to a domain controller (dcpromo.exe)
Step 1: Adding the ADDS role
- Open Server Manager
- Click Manage → Add Roles and Features
- Click Next > until the Server Roles phase.
- Select Active Directory Domain Services.
- Press Next > and Finish until the end of process.
Warning: Do not run the dcpromo (DC promotion) yet.
Step 2: Install certificate
- Open mmc.
- Add/Remove Snap-in… (Ctrl+M)
- Certificates
- Add >
- Service Account
- Local Computer
- Active Directory Domain Services
- Finish, OK
- Import the .pfx or .p12 into NTDS\Personal
Step 3: dcpromo
Run dcpromo (domain controller promotion) from the Server Manager. You will notice a yellow triangle with exclamation mark, it is enough to follow it.
Test it!
After you restart the server, it should probably work. To test it, try an OpenSSL command
openssl s_client -host dc1.example.com -port 636
If you see the desired certificate information, you’re done.
Conclusion
Hope the tutorial was useful. Let me know if that works for you and feel free to comment.